首页 > 服务器 > Linux服务器 > 正文

详解linux tail命令显示最后n行

2024-09-05 23:04:51
字体:
来源:转载
供稿:网友

tail :输出文件的最后几行。

用于linux查看日志的时候很方便,假如日志文件为:Console.log

用法

1. tail Console.log

输出文件最后10行的内容

2. tail -nf Console.log --n为最后n行

输出文件最后n行的内容,同时监视文件的改变,只要文件有一变化就同步刷新并显示出来

3. tail -n 5 filename

输出文件最后5行的内容

4. tail -f filename

输出最后10行内容,同时监视文件的改变,只要文件有一变化就显示出来。


注:相关教程知识阅读请移步到服务器教程频道。
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表