10月21, 2020

tail实时滚动显示log文件内容

Linux shell中有一个tail命令,常用来显示一个文件的最后n行文档内容

但更多情况下,我们要在服务器端运行程序,并且需要实时监控运行日志,这时候有什么办法实时滚动显示log文件内容?

这里可以利用tail命令加参数f实现,具体用法如下:

tail -f ***.log

参数说明-f, --follow[={name|descriptor}]:output appended data as the file grows; -f, --follow, and --follow=descriptor are equivalent

tail其它参数运行 man tail 查看

本文链接:https://587v5.com/post/tail-shi-shi-gun-dong-xian-shi-log-wen-jian-nei-rong.html

Comments