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.logThat will output the first 1000 lines of a file.
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
Did you find this post helpful? Leave a comment below, and subscribe to my RSS feed.