In the following article, I illustrate several common use cases of
multitail command to Monitor Multiple Log Files in real taime.
1. Monitor multiple log files as they grow in horizontally-split screens.
The terminal screen will automatically be split into the number of log files specified.
$ sudo multitail --follow-all /var/log/auth.log /var/log/kern.log /var/log/syslog
2. Monitoring log files as they grow in vertically-split screens.
-s N” option to vertically split the screen into
$ sudo multitail -s 3 --follow-all /var/log/auth.log /var/log/kern.log /var/log/syslog
3. Monitor command outputs simultaneously
Besides tailing log files,
multitail can also monitor the output of an external command whiles the execution of the command is in progress. For this, use “
-l "command-to-run"” option. For example, you can run multiple
ping commands, and monitor individual
ping outputs simultaneously in split screens as follows.
$ multitail -l "ping twitter.com" -l "ping google.com"
In this article, we showed how to watch data being appended in log files in real-time on the terminal in Linux.