Continuously Watch a Text File in UNIX

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: UNIX  

Using the tail command with an option, the file will remain open and you will see any additional output written to the file. This is especially useful for watching log files.

Basic structure of the tail command is like this:
tail -f filename

For example, to monitor any new output to /var/log/messages:

tail -f /var/log/messages

 

2 Comments -


  1. Name said on January 8, 2010

    just what I wanted. Thanks

  2. Dan said on June 24, 2011

    Wow… I wish I had found this a while ago.

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -