How to tail multiple files at once in Linux
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:
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.