How to use Tail to monitor a log file on Linux

Updated April 28, 2020 · Published August 01, 1999

By default, Tail 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 for a very handy tool for when monitoring log files.

tail -f /var/log/messages
tail -f /var/log/system.log | grep "saucepan"