Sauce Pan

Technology how-to guides for macOS, Linux, Windows, and Cloud providers

How to use Tail to monitor a log file on Linux

Updated 2020-04-28 · Published 1999-08-01

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"