Continuously watch a text file in UNIX

Contributor Icon Contributed by qmchenry Date Icon September 5, 2003  
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.


To monitor any new output to /var/log/messages:

tail -f /var/log/messages

Previous recipe | Next recipe |
 
  • Anonymous
    You missed a /

    tail -f /var/log messages should read
    tail -f /var/log/messages
  • qmchenry
    Thank you for catching this and bringing to my attention. I fixed the recipe. Good catch!
blog comments powered by Disqus