head - output beginning portion of one or more files
head [ options ] [ file ... ]
copies one or more input files to standard output stopping at a designated point for each file or to the end of the
file whichever comes first. Copying ends at the point indicated by the options. By default a header of the form ==> filename
is output before all but the first file but this can be changed with the -q
If no file is given, or if the file is -, head copies from standard input starting at the current
The option argument for -c, and -s can optionally be followed by one of the following characters to specify a
different unit other than a single byte:
- 512 bytes.
For backwards compatibility, -number
is equivalent to -n number
- -n, --lines=lines
Copy lines lines from each file. The default value is 10.
- -c, --bytes=chars
Copy chars bytes from each file.
- -q, --quiet|silent
Never ouput filename headers.
- -s, --skip=skip
Skip skip characters or lines from each file before copying.
- -v, --verbose
Always ouput filename headers.
- All files copied successfully.
One or more files did not copy.