first few lines of files
utility copies the first
lines of each specified
to the standard output. If no files are
copies lines from the standard input.
is omitted, it defaults to 10.
The options are as follows:
- Copy the first count lines
of each input file to the standard output.
count must be a positive decimal
If more than one file is specified, head
the output of each file with the following, in order to distinguish files:
utility exits 0 on success,
and >0 if an error occurs.
To display the first 500 lines of the file foo
$ head -n 500 foo
can be used in conjunction with
in the following way to,
for example, display only line 500 from the file
$ head -n 500 foo | tail -1
utility is compliant with the
IEEE Std 1003.1-2008
The historic syntax
supported by this implementation.
utility first appeared in
, August 24, 1977.