If you are a Linux system administrator, monitoring log files on a server host will be one of your daily routines. The tail command comes in handy as you can monitor a log file in real-time as it grows, by running tail with "-f" option.
What if you want to monitor more than one log file at the same time? You could run tail on multiple terminals, or launch multiple instances of tail in one terminal by using terminal multiplexers such as screen. But neither approach is convenient in monitoring mupltiple log files at once.
In this post, I will describe how to tail multiple files at once in Linux, by using a command-line tool called multitail.
multitail creates ncurses-based multiple screens inside a terminal, each of which can run a separate instance of tail-like file viewer.
To install multitail on Ubuntu or Debian:
To install multitail on Fedora:
To install multitail on CentOS or RHEL, first set up Repoforge on your system, and then run:
Monitor multiple log files as they grow in horizontally split screens
Monitor multiple log files as they grow in vertically split screens
Monitor multiple command outputs simultaneously
Besides tailing log files, multitail can also monitor the output of an external command, as the execution of the command is in progress. For example, you can run multiple ping commands, and monitor individual ping outputs simultaneously in split screens as follows.
Subscribe to Xmodulo
Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to install Suricata intrusion detection system on Linux - September 3, 2015
- How to switch from NetworkManager to systemd-networkd on Linux - August 31, 2015
- How to set up a system status page of your infrastructure - August 25, 2015