"tail syslog" shows the last ten lines of syslog.
"tail -20 syslog" shows the last 20 lines.
"tail +2 syslog" displays from line 2 to the end.
"tail -f syslog" shows the last ten lines, but then continues to monitor any new lines added and will show those as they occur.
On some systems, you'll have "tailf". It works like "tail -f", but is designed for laptops and portables where you want to conserve battery life: it's main advantage is that it doesn't read the file unless it actually changes, so it doesn't spin up powered down drives.
Tail can also work with characters rather than lines, though I can't think when I ever had the need for that.
GNU tail (Linux - "info tail") is a feature rich version of this old Unix favorite.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-07-06 Tony Lawrence
In fact, my main conclusion after spending ten years of my life working on the TEX project is that software is hard. It’s harder than anything else I’ve ever had to do. (Donald Knuth)