linux poison RSS
linux poison Email

How to Watch Log Files in Realtime - Tailf

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  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


Post a Comment

Related Posts with Thumbnails