linux抓取日志

1.在logs目录下创建一个用来存放数据的文件 test.log,命令为

touch test.log

2.使用命令将catalina.out文件的最后n行输出到test.log中,命令为

tail -n catalina.out > test.log


如想要把最后10000行输出到test.log中,则使用

tail -10000 catalina.out > test.log


3、抓取文件
tail -f catalina.out > test.log


posted @ 2018-07-02 13:55  逝年的我们  阅读(2173)  评论(0编辑  收藏  举报