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

Unix Power ToolsUnix Power ToolsSearch this book

12.9. Finer Control on tail

What if you need to look at the last 11 lines of the file? The command tail -n shows the final n lines. The command tail +n discards the first n-1 lines, giving you line n and everything that follows it.

You can also tell tail to count the number of characters or the number of 512-byte blocks. To do so, use the -c option (count characters) or the -b option (count blocks). If you want to state explicitly that you're interested in lines, give the -l option.

Your tail probably has a -r option that shows the file in reverse order, starting from the last line.

Many versions of Unix limit the maximum number of lines that tail, especially tail -r, can display.

-- ML

Library Navigation Links

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