head(1) — Commands
NAME
head − Displays the beginning of files
SYNOPSIS
Current Syntax
head [-c bytes] [-n lines] [file...]
Obsolescent Syntax
head [-lines] [file ...]
The head command prints the first count lines of each of the specified files to standard output.
FLAGS
The default count is 10.
-c bytesSpecifies the number of bytes to display. If the last byte written is not a newline character, a newline character is appended to the output.
-n linesSpecifies the number of lines to display
- linesWorks exactly as -nlines. Obsolescent.
DESCRIPTION
If you do not specify a file, head reads standard input.
EXAMPLES
To display the first 5 lines of a file called test, enter:
head -n 5 test