View Files on stdout


cat

DOS users have the type command that displays the contents of text files on a screen. Linux users can use cat, which does the same thing. Want to view a file in the shell? Try cat.

$ cat Hopkins_-_The_Windhover.txt I caught this morning morning's minion, kingdom of daylight's dauphin, dapple-dawn-drawn Falcon, in his riding   Of the rolling level underneath him steady air, and striding High there, how he rung upon the rein of a wimpling wing In his ecstasy! then off, off forth on swing,   As a skate's heel sweeps smooth on a bow-bend: the hurl and gliding   Rebuffed the big wind. My heart in hiding Stirred for a bird, -- the achieve of, the mastery of the thing! Brute beauty and valour and act, oh, air, pride, plume, here   Buckle! AND the fire that breaks from thee then, a billion Times told lovelier, more dangerous, o my chevalier!   No wonder of it: sheer plod makes plough down sillion Shine, and blue-bleak embers, ah my dear,   Fall, gall themselves, and gash gold-vermilion. $ 


The cat command prints the file to the screen, and then deposits you back at the command prompt. If the file is longer than your screen, you need to scroll up to see what flashed by.

That's the big problem with cat: If the document you're viewing is long, it zooms by, maybe for quite a while, making it hard to read (can you imagine what this would produce: cat Melville_-_Moby_Dick.txt?). The solution to that is the less command, discussed in "View Text Files a Screen at a Time" later in this chapter.



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