UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 25.16 How to Look at a File as It Grows Chapter 25
Showing What's in a File
Next: 25.18 Watching Several Files Grow
 

25.17 An Alias in Case You Don't Have tail

Some System V UNIX versions don't support the tail command (25.14). Here are a shell function and alias named ptail that give you an equivalent:


ptail() { sed -e :a -e '$q;N;11,$D;ba' $1; }

alias ptail sed -e :a -e \''$q;N;11,$D;ba'\'

This prints the last ten lines of a file. (Greg Ubben wrote ptail.)

- JP


Previous: 25.16 How to Look at a File as It Grows UNIX Power ToolsNext: 25.18 Watching Several Files Grow
25.16 How to Look at a File as It Grows Book Index25.18 Watching Several Files Grow

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