Linux tail命令
tail命令與head命令用法相似linux命令大全,tail命令用于查看文檔的尾端指定數(shù)量的字符塊,默認(rèn)顯示文檔的最后 10 行,
如果給定的文件不止一個,則在顯示的每個文件前面加一個文件名標(biāo)題。
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,顯示文檔結(jié)尾的前 k 字節(jié),+k,不顯示文檔開始的前 k-1 字節(jié) -f, --follow[={name|descriptor}] 動態(tài)監(jiān)視文檔最新追加的內(nèi)容 -n, --lines=K k,顯示文檔結(jié)尾的 k 行,+k,不顯示文檔開始的前 k-1 行 -q, --quiet, --silent 當(dāng)有多個文件參數(shù)時,不輸出各個文件名 -s, --sleep-interval=N 與“-f”選項連用,指定監(jiān)視文件變化時間隔的秒數(shù) --help 顯示此幫助信息并退出 --version 顯示版本信息并退出
上一個教程:linux常見命令實踐.
下一個教程:Linux常用命令快捷鍵