5.13 查看多个文件的最后10行内容

tail file1 file2

使用head命令可以一次查看多个文件的前10行内容,同样,使用tail命令也可以做类似的事,这一点儿也不奇怪。

  1. $ tail Paradise_Lost.txt Miller's_Tale.txt
  2. ==> Paradise_Lost.txt <==
  3. To the subjected plain - then disappeared
  4. They, looking back, all the eastern side beheld
  5. Of Paradise, so late their happy seat,
  6. Waved over by that flaming brand; the gate
  7. With dreadful faces thronged and fiery arms.
  8. Some natural tears they dropped, but wiped them soon;
  9. The world was all before them, where to choose
  10. Their place of rest, and Providence their guide.
  11. They, hand in hand, with wandering steps and slow,
  12. Through Eden took their solitary way.
  13. ==> Miller's_Tale.txt <==
  14. With othes grete he was so sworn adoun
  15. That he was holde wood in al the toun;
  16. For every clerk anonright heeld with oother.
  17. They seyde, The man is wood, my leeve brother”;
  18. And every wight gan laughen at this stryf.
  19. Thus swyved was this carpenteris wyf,
  20. For al his kepyng and his jalousye;
  21. And Absolon hath kist hir nether ye;
  22. And Nicholas is scalded in the towte.
  23. This tale is doon, and God save al the rowte!

head命令一样,tail命令也使用标题(分隔符)来分隔不同的文件,这非常有用。