DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Working with files and directories

Looking at the beginning and end of a file

To look at the first ten lines of a file, use the head(C) command:

head filename

To look at the last ten lines of a file, use the tail(C) command:

tail filename

If you use a numerical option, for example -20, head or tail will print that number of lines (20) instead of ten, the default, as follows:

   $ head -20 file6.txt

Next topic: Copying a file
Previous topic: Finding out how much text is in a file

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003