Linux tail命令
tail命令与head命令用法相似linux命令大全,tail命令用于查看文档的尾端指定数量的字符块,默认显示文档的最后 10 行,
如果给定的文件不止一个,则在显示的每个文件前面加一个文件名标题。
tail命令的帮助文档
DESCRIPTION
Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each
with a header giving the file name.
With no FILE, or when FILE is -, read standard input.
Mandatory arguments to long options are mandatory for short options too.
-c, --bytes=[+]NUM
output the last NUM bytes; or use -c +NUM to output starting with byte NUM of each file
-f, --follow[={name|descriptor}]
output appended data as the file grows;
an absent option argument means 'descriptor'
-F same as --follow=name --retry
-n, --lines=[+]NUM
output the last NUM lines, instead of the last 10; or use -n +NUM to output starting with
line NUM
--max-unchanged-stats=N
with --follow=name, reopen a FILE which has not
changed size after N (default 5) iterations to see if it has been unlinked or renamed (this
is the usual case of rotated log files); with inotify, this option is rarely useful
2、命令选项
-c, --bytes=K k,显示文档结尾的前 k 字节,+k,不显示文档开始的前 k-1 字节 -f, --follow[={name|descriptor}] 动态监视文档最新追加的内容 -n, --lines=K k,显示文档结尾的 k 行,+k,不显示文档开始的前 k-1 行 -q, --quiet, --silent 当有多个文件参数时,不输出各个文件名 -s, --sleep-interval=N 与“-f”选项连用,指定监视文件变化时间隔的秒数 --help 显示此帮助信息并退出 --version 显示版本信息并退出
上一个教程:linux常见命令实践.
下一个教程:Linux常用命令快捷键