start page | rating of books | rating of authors | reviews | copyrights

Unix Power ToolsUnix Power ToolsSearch this book

12.12. Printing the Top of a File

head can be used to print the first few lines of one or more files (the "head" of the file or files). When more than one file is specified, a header is printed at the beginning of each file, and each is listed in succession.

Like tail (Section 12.9), head supports the -n option to control the number of lines displayed and the -c option to print characters/bytes instead of lines. GNU head also supports an extention to -c: -c nk prints the first n kilobytes of the file, and -c nm prints the first n megabytes of the file.

-- DJPH



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.