Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

How to view live a log file in Linux

Date: 2010-04-07 00:00:00 -0400

Log files are important when debugging or just to check how a system is performing, we usually use cat to list the log on the screen, but if we want to see a live view of the log file, the command is:

tail -f /var/log/logfile.log

It will display the last lines of the log file actually the tail of it, you can see more about tail command.

The -f option makes it wait for more lines, which will be displayed on the screen as soon as they are written to the file, so you can in real time the log file growing.

For example in Debian or Ubuntu to see the Apache log, you can enter.

tail -f /var/log/apache2/access.log

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.