tailf – Watch logs in realtime

The most widely used command for monitoring log file is tail. Tail binary allows a user to watch the log file grow in realy time. Watching the log file grows can be done using an additional -f parameter. Alternatively, another approach to watch a log file grows can be done using tailf binary command.

Tailf:
tailf will print out the last 10 lines of a file and then wait for the file to grow. It is similar to tail -f but does not access the file when it is not grow-ing. This has the side effect of not updating the access time for the file, so a filesystem flush does not occur periodically when no log activity is happening.

tailf is extremely useful for monitoring log files on a laptop when logging is infrequent and the user desires that the hard disk spin down to conserve battery life.

Example:

tailf /var/log/squid/access.log

Similarly you can watch the same log file using -f argument

Example:

tail -f /var/log/squid/access.log

tailf is similar to

less +F /var/log/exim_mainlog

without the pause and resume features. See the less +F post here.

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.