Linux学习笔记之tail命令显示最后n行

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

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

tail
# 输出文件最后10行的内容

2.  tail -f Console.log

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

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

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

4.  tail -n 10 filename

tail -n 10
#输出文件最后10行的内容
原文地址:https://www.cnblogs.com/JetpropelledSnake/p/10869248.html