Following log files with tail -f
UNIX is a majestic onion of discovery. Every day a new layer of understanding can be peeled away to give some new pungent goodness. Today's was the 'follow' option of the tail command.
It's commonplace to use tail for viewing the recent entries to a log file:
Much more useful is set the 'follow' option so that, rather than echoing to STDOUT and returning control to the prompt - tail continues to watch the file in question and echos additional lines to the terminal. This can be very useful during development - I often leave a terminal open watching the error logs while I develop - so that I can quickly pounce on any errors that pop up.
Return control to the command prompt using CTRL+C (or run as a background process using &). This can be quite useful for monitoring the error logs of production sites where echoing error messages and warnings to the screen would be unacceptable.
About this entry
You’re currently reading “Following log files with tail -f,” an entry on Code in the hole
- Posted by:
- David Winterbottom at
22.10.2008 / 09:03
Last updated 17.03.2010
- Category:
- Tidbits

No comments
Jump to comment form | Comments RSS | Trackback specific URI for this entry