home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


tail

tail [options ] [file ]

Print the last ten lines of the named file . Use only one of -f or -r .

Options

-f

Don't quit at the end of file; "follow" file as it grows. End with an INTR (usually ^C ).

-r

Copy lines in reverse order.

- n [k ]

Begin printing at n th item from end of file. k specifies the item to count: l (lines, the default), b (blocks), or c (characters).

- k

Same as previous, but use the default count of 10.

+ n [k ]

Like - n , but start at n th item from beginning of file.

+ k

Like - k , but count from beginning of file.

Examples

Show the last 20 lines containing instances of .Ah :

grep '\.Ah'

 file
 | tail -20

Continually track the latest uucp activity:

tail -f /var/spool/uucp/LOGFILE

Show the last 10 characters of variable name :

echo "$name" | tail -c

Reverse all lines in list :

tail -r list


Previous: Reference: su UNIX in a Nutshell: System V Edition Next: Reference: talk
Reference: su Book Index Reference: talk

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