User Commands head(1) NAME head - display first few lines of files SYNOPSIS /usr/bin/head /usr/bin/head [ options ] [file...] ksh93 head [ options ] [file...] DESCRIPTION head 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 and -v options. If no file is given, or if the file is -, head copies from standard input starting at the current location. 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: b 512 bytes. k 1-killobyte. m 1-megabyte. For backwards compatibility, -number is equivalent to -n number. OPTIONS The following options are supported: -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. --man, --html, --nroff Prints builtin manual page in either plain text, HTML or nroff format. --help Prints basic help information --version Prints version information If no options are specified, head will act as if -n 10 had been specified. OPERANDS The following operand is supported: file A path name of an input file. If no file operands are specified, the standard input will be used. USAGE See largefile(5) for the description of the behavior of head when encountering files greater than or equal to 2 Gbyte ( 2 **31 bytes). EXAMPLES Example 1: Writing the first ten lines of all files To write the first ten lines of all files (except those with a leading period) in the directory: example% head * ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of head: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| | CSI | enabled | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| This command conforms to IEEE Std 1003.1-2008. SEE ALSO cat(1), ksh93(1), more(1), pg(1), tail(1), tee(1), attributes(5), environ(5), largefile(5), standards(5), http://www.opengroup.org/onlinepubs/9699919799/utilities/head.html SunOS 5.10 Last change: 1 Feb 1995 2