head — Display First Few Lines of Files

Synopsis

/usr/bin/head [-number | -n number] [filename...] 

Description

The head command copies the first number of lines of each filename to the standard output. If you specify no file name, head copies lines from the standard input. The default value of number is 10 lines.

When you specify more than one filename , the start of each file displays the file name betwen two arrows, as shown below.

==> filename <== 

The following example shows a common way to display a set of short files, identifying each one by name.

castle% head -9999 kookaburra1 kookaburra2 ==> kookaburra1 <== Kookaburra sits in the old gum tree Merry merry king of the bush is he Laugh, kookaburra, laugh, kookaburra Gay your life ...

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.