View the First 10 Lines of a File


head

If you just need to see the first 10 lines of a file, such as Chaucer's Canterbury Tales, there's no need to use either cat or less. Instead, use the head command, which prints out exactly the first 10 lines of a file and then deposits you back on the command line.

$ head Canterbury_Tales.txt Here bygynneth the Book of the Tales of Caunterbury General Prologue Whan that Aprill, with his shoures soote The droghte of March hath perced to the roote And bathed every veyne in swich licour, Of which vertu engendred is the flour; Whan Zephirus eek with his sweete breeth Inspired hath in every holt and heeth $ 


The head command is great for quick glances at a text file, even if that file is enormous. In just a second, you see enough to know if it's the file you need or not.



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