Topics:
DVR
nvrec
Mplayer
Links
Misc
Commands
Humor
New user
uploaded files
|
(linux_command_line)-> (Parent)->display last 20 lines of a file linux |
submited by Russell Mon 19 Dec 05 Edited Mon 30 Jan 06 |
To display last 20 lines of a file linux use the tail command.
$ tail -20 bigfile.txt
Displays the last 20 lines. The default is 10 if you leave out the -n option.
Other useful options:
$ tail -c 100 bigfile.txt
Displays the last 100 bytes of the file ( without reguard for the lines). This can be used on binary files if you know what you are doing.
The head command is the same as tail except that it operates on the begining of the file.
To get lines out of the middle of the file you can use them together:
cat bigfile.txt |head -10|tail -2
extracts lines 9 and 10 only.
This post is in responce to a hit from this search
|
Add comment or question...:
|