linux抓取日志

it2022-05-05  115

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.log3、抓取文件tail -f catalina.out > test.log

转载于:https://www.cnblogs.com/wwwcf1982603555/p/9253486.html

相关资源:服务器日志抓取脚本网络、线程等

最新回复(0)