Home OS X
OS X Syntax

head

Display the first lines of a file

SYNTAX
      head [-n count] [file ...]

This filter displays the first count lines of each of the specified files, or of the standard input if no files are specified.

If count is omitted it defaults to 10.

If more than a single file is specified, each file is preceded by a header consisting of the string `==> XXX <==' where `XXX' is the name of the file.

The head utility exits 0 on success, and >0 if an error occurs.

"If you can keep your head when all about you are losing theirs and blaming it on you..." - Rudyard Kipling

Related commands:

fmt - Reformat paragraph text
join - Join lines on a common field
split - Split a file into fixed-size pieces
tail - Output the last part of files

Equivalent BASH command:

head - Display the first lines of a file



Back to the Top

Simon Sheppard
SS64.com