Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)
head(1) OSS Shell and Utilities Reference Manual
NAME
head - Displays the beginning of a file
SYNOPSIS
head [-c bytes][-n lines][file ...]
FLAGS
-c bytes Specifies the number of bytes (not characters) to display. If the last byte written is not
a newline character, a newline character is appended to the output.
-n lines Specifies the number of lines to display. The default value for lines is 10.
DESCRIPTION
The head command prints the first lines lines or bytes bytes of each of the specified files to the
standard output file.
If you do not specify file, head displays from the standard input file.
Environment Variables
This command supports the use of the LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and
NLSPATH environment variables.
EXAMPLES
To display the first 5 lines of a file named test,enter:
head -n 5 test
EXIT VALUES
The head command returns the following values:
0 (zero) The command completed sucessfully.
>0 An error occurred.
RELATED INFORMATION
Commands: cat(1), more(1), tail(1).
STANDARDS CONFORMANCE
This command conforms to the XPG4 Version 2 specification.
The following feature is an extension to the XPG4 Version 2 specification:
• The -c flag is supported.
4−42 Hewlett-Packard Company 527188-004