Checking log files can be such a pain sometimes, especially if you’re doing it regularly. For example, when I’m coding up a web app, I find it useful to keep an eye on the Apache error logs with something like this :
tail /var/log/apache2/error.log
However, if I add the option -f to tail, it will follow the file I’m reading and give me live updates as and when new lines are added.
tail -f /var/log/apache2/error.log
Instead of exiting after it has read the file, tail will now stay open and update new lines in the terminal as they appear.
To exit, just use ctrl-c
This will work with any other text files that get updated, for example, if you like to know when people are viewing your page, live, check out the access logs with :
tail -f /var/log/apache2/access.log