(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.|
Displays the last 20 lines. The default is 10 if you leave out the -n option.
$ tail -20 bigfile.txt
Other useful options:
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.
$ tail -c 100 bigfile.txt
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:
extracts lines 9 and 10 only.
cat bigfile.txt |head -10|tail -2
This post is in responce to a hit from this search
Add comment or question...: