Monitor Log Files in Real Time using tail

tail Command – Monitor Logs in Real Time

As said, tail command is the most common solution to display a log file in real time. However, the command to display the file has two versions, as illustrated in the below examples.

  • In the first example the command tail needs the -f argument to follow the content of a file.
sudo tail -f /var/log/apache2/error.log
  • The second version of the command is actually a command itself: tailf. You won’t need to use the -f switch because the command is built-in with the -f argument.
sudo tailf /var/log/apache2/error.log


Tagged:
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!