5.14 查看一个或多个文件的后面几行内容
tail -n
继续介绍head
命令和tail
命令的相似之处。除了接受默认的10行,也可以使用-n
(或--lines=
)选项来指定想要查看的文件行数。想要查看多个文件的后面几行?只要把多个文件名加到命令中就可以了。
$ tail -n 4 Paradise_Lost.txt Miller's_Tale.txt
==> Paradise_Lost.txt <==
The world was all before them, where to choose
Their place of rest, and Providence their guide.
They, hand in hand, with wandering steps and slow,
Through Eden took their solitary way.
==> Miller's_Tale.txt <==
For al his kepyng and his jalousye;
And Absolon hath kist hir nether ye;
And Nicholas is scalded in the towte.
This tale is doon, and God save al the rowte!
想查看多个日志文件吗?这是个挺有用的命令。但它还不完美,要看看完美的命令,请阅读下一节。