[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: reading the end of file



On 2009-07-23 01:45, Ekkard Gerlach wrote:
* Francesco Pietra schrieb:

Hi:

Is any command faster than

cat filename

to reach and print on screen the last page of the file?

what kind of "file"? tail -n 10 filename
makes output of last 10 lines of a file. But if there are no
linefeeds/ carriage return in the files, the it makes no sense. tac filename > filename_taced

Hey, cool.  I never knew that...

turns around a file, the end becomes the beginning. head -n 10 filename_taced | tac

Why use an intermediary file instead of a pipe?

$ tac filename | head -n10

--
Scooty Puff, Sr
The Doom-Bringer


Reply to: