head can be used to print the first few lines of one or more files (the "head" of the file or files). When more than one file is specified, a header is printed at the beginning of each file, and each is listed in succession.
Like tail (Section 12.9), head
supports the -
n
option to control the number of lines displayed and
the -c
option to print characters/bytes instead of lines.
GNU head also supports an extention to -c
:
-c
n
k prints the first n
kilobytes of the file, and -c
n
m prints the first n
megabytes of the file.
— DJPH