How to use Tail to monitor a log file on Linux
Published: 01 August 1999
Updated: 28 April 2020
Filed Under: Linux
By default, the Tail program displays the last 10 lines of a file and closes. By combining it with an optional follow flag, you can watch the file for appended data in real time. If you combine this with the Grep utility, you can filter the log file to only display something when it matches a specific search criteria. This makes a handy tool for when monitoring log files.
tail -f /var/log/messages tail -f /var/log/system.log | grep "saucepan"