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
![](https://www.xmodulo.com/img/811a.jpg)
2. Monitoring log files as they grow in vertically-split screens.
Use “-s N
” option to vertically split the screen into N
columns.
$ sudo multitail -s 3 --follow-all /var/log/auth.log /var/log/kern.log /var/log/syslog
![](https://www.xmodulo.com/img/811b.jpg)
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"
![](https://www.xmodulo.com/img/811c.jpg)
Conclusion:
In this article, we showed how to watch data being appended in log files in real-time on the terminal in Linux.Â