Head and Tail

Tags:

head

Use head to get the first 10 lines of a file. To change the number of lines use the -n option like this:

head -n 1000 access.log

That will output the first 1000 lines of a file.

tail

To get the last 10 lines of a file, use tail. To change the number of lines, use the -n option. The following command outputs the last 1000 lines of a file name access.log:

tail -n 1000 access.log
No votes yet
Syndicate content