head
Format:
head -number files
Head is used to display the first ten lines of a file. To display less or more lines use the -number option. For example,
$ head -1 myfile
will display the first line of the file only, and
$ head -30 logfile |more
displays the first 30 lines of the file logfile.
Get Linux and Unix Shell Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.