View the Last 10 Lines of a File


tail

The head command allows you to view the first 10 lines of a file, and in typical whimsical Unix fashion, the tail command allows you to view the last 10 lines of a file. From head to tail, get it?

$ tail Paradise_Lost.txt To the subjected plain - then disappeared They, looking back, all the eastern side beheld Of Paradise, so late their happy seat, Waved over by that flaming brand; the gate With dreadful faces thronged and fiery arms. Some natural tears they dropped, but wiped them soon; 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. 


Why use tail? Most often, to view the end of a log file to see what's going on with an application or your system. Of course, there's an important option you want to use in that case, as you'll learn in the upcoming "View the Constantly Updated Last Lines of a File or Files" 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