Using the TAIL command to review log files

The ‘tail’ command is an easy way of viewing the last few lines of any file (most frequently log files).

By default, ‘tail’ prints the last ten lines of a file. This is really useful if you need to check the most recent activity in an otherwise lengthy log file, but can also be useful for checking out shorter files without the need to open a text editor.

Usage of the command is as simple as this…

tail [OPTION]... [FILE]...

A useful option is the ‘-follow’ (or ‘-f’) parameter. This instructs tail to follow the file and display any data appended to it after the command has been executed. This is useful for monitoring logs in a live environment.

tail -f /var/log/messages

Be the first to comment on "Using the TAIL command to review log files"

Leave a comment

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.