View the Last Several Lines of a File or Files


tail -n

Continuing the similarities between head and tail, you can specify the number of a file's lines you want to see instead of accepting the default of 10 by utilizing the -n (or --lines=) option. Want to see more than one file? Just add it to your command.

$ 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! 


Do you have more than one log file that you want to view? Then this is a useful command. But it's still not perfect. For the perfect command, read the next section.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net