NAME
head — give first few lines
SYNOPSIS
head
[-c|-l]
[-n
count]
[file ...]
Obsolescent:
head
[-count]
[file ...]
DESCRIPTION
head
prints on standard output the first
count
lines of each of the specified files, or of the standard input.
If
count
is omitted it defaults to 10.
If multiple
files
are specified,
head
outputs before each file a line of this form:
Options
- -c
The quantity of output is measured in bytes.
- -count
The number of units of output.
This option is provided for backward compatibility (see
-n
below) and is mutually exclusive of all other options.
- -l
The quantity of output is measured in lines; this is the default.
- -n count
The number of lines (default) or bytes output.
count
is an unsigned decimal integer.
If
-n
(or
-count)
is not given, the default quantity is 10.
This option provides the same functionality as the
-count
option, but in a more standard way.
Use of the
-n
option is recommended where portability between systems is important.
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE
determines the interpretation of text within file
as single and/or multi-byte characters.
LC_MESSAGES
determines the language in which messages are displayed.
If
LC_CTYPE
or
LC_MESSAGES
is not specified in the environment or is set to
the empty string, the value of
LANG
is used as a default for each
unspecified or empty variable.
If
LANG
is not specified or is set to the empty string, a default of "C" (see
lang(5))
is used instead of
LANG.
If any internationalization variable contains an invalid setting,
head
behaves as if all internationalization variables are set to "C".
See
environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
WARNINGS
The length of the input lines is limited to
{LINE_MAX}
bytes.
STANDARDS CONFORMANCE
head: SVID3, XPG4, POSIX.2