UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: gzipChapter 2
Unix Commands
Next: Reference: help
 

head

head [options] [files]

Print the first few lines of one or more files (default is 10).

Options

-n

Print the first n lines of the file.

-n n

Print the first n lines of the file. Solaris only.

Examples

Display the first 20 lines of phone_list:

head -20 phone_list

Display the first 10 phone numbers having a 202 area code:

grep '(202)' phone_list | head


Previous: Reference: gzipUNIX in a Nutshell: System V EditionNext: Reference: help
Reference: gzipBook IndexReference: help

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System