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

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005