Stack Engineer

Use Tail to Monitor a Log File

The tail command displays the last 10 lines of a file. By combining it with an option flag, you can watch the file for appended data in real time. This makes a handy tool for when monitoring log files.

tail -f /var/log/messages

You can combine this with grep to pipe the data for filtering only what if something matches your search pattern.

tail -f /var/log/messages | grep "stackengineer"