View the First 10 Lines of Several Files


head file1 file2

You can use head to view the first 10 lines of several files at one time. This sounds a bit similar to cat, and it is, except that head helpfully provides a header that separates the files so it's clear which one is which. Here's the first ten lines of Chaucer's Canterbury Tales and Milton's Paradise Lost.

$ head Canterbury_Tales.txt Paradise_Lost.txt ==> 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 ==> Paradise_Lost.txt <== Book I Of Man's first disobedience, and the fruit Of that forbidden tree whose mortal taste Brought death into the World, and all our woe, With loss of Eden, till one greater Man Restore us, and regain the blissful seat, Sing, Heavenly Muse, that, on the secret top Of Oreb, or of Sinai, didst inspire That shepherd who first taught the chosen seed 


The head command automatically separates the two excerpts with a space and then a header, which really makes it easy to see the different files clearly.



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