MultiTail – Monitor Multiple Files Simultaneously in a Single Linux Terminal

Take Your Linux Skills to the Next Level All courses, certifications, ad-free articles & community — from $8/mo
Join Root →
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA)
Access new courses on release
Get access to weekly newsletter
Priority help in comments
Private Telegram community
Connect with the Linux community
From $8/mo · or $59/yr billed annually · Cancel anytime

Whether it’s a server administrator or a programmer some time we need to refer multiple logfiles for effectively troubleshooting tasks. To achieve this we have to open, tail or less a each logfile in a different shell. However, we can use traditional tail command like tail -f /var/log/messages or tail -f /var/log/secure in a single line. But if we want to see multiple files in a real-time we need to install a specific tool called MultiTail.

What is MultiTail?

MultiTail is an open source ncurses utility that can be used to display multiple logfiles to standard output in a single window or a single shell that shows last few lines of logfiles in a real-time like tail command which split console into more subwindows (much like screen command). It also supports color highlighting, filtering, adding and deleting windows and much more.

Features

  1. Multiple input sources.
  2. Color display using Regular Expression in the case of important informations.
  3. Line filtering.
  4. Interactive Menus for deleting and adding shells.

Here is an example screen grab of MultiTail in action.

Install MultiTail in Linux
MultiTail View

Installation of MultiTail in Linux

To get MultiTail on Red Hat based distributions, you must turn on EPEL repository and then run the following command on the terminal to install it.

On RHEL/CentOS/Fedora
# yum install -y multitail
On Debian/Ubuntu/Linux Mint
$ sudo apt-get update
$ sudo apt-get install multitail

Usage of MultiTail

By default MultiTail does the same thing as ‘tail -f‘, i.e. view files in a real time. To view/monitor two different files in one window, the basic syntax is:

1. How To View 2 Files in Single Window

root@tecmint:~# multitail /var/log/apache2/error.log /var/log/apache2/error.log.1
View Two Files in Linux
View Two Files in Linux

To scroll through the files, hit ‘b‘ and select the file you want from the list.

File Selection
File Selection

Once, you select the file, it will show you last 100 lines of that selected file, to scroll through use the cursor keys. You can also use ‘gg‘/’G‘ to move to the top/bottom of the scroll window. If you want to view more lines, hit ‘q’ to exit and hit ‘m‘ to enter a new value for the number of lines to view.

View File
View File

2. How To View 2 Files in 2 Columns

The following command will display two different files in 2 columns.

[root@tecmint ~]# multitail -s 2 /var/log/mysqld.log /var/log/xferlog
View Files in 2 Columns
View Files in 2 Columns

3. How To View Multiple Files in Multiple Columns

Display 3 files in three columns.

[root@localhost ~]# multitail -s 3 /var/log/mysqld.log /var/log/xferlog /var/log/yum.log
View Files in 3 Columns
View Files in 3 Columns

4. Merge/View Multiple Files in Multiple Columns

Displays 5 logfiles while merging 2 files in one column and keep 2 files in two columns with only one in the left column.

[root@localhost ~]# multitail -s 2 -sn 1,3  /var/log/mysqld.log -I /var/log/xferlog /var/log/monitorix /var/log/ajenti.log /var/log/yum.log
Multiple View Files
Multiple View Files

5. How to View File and Execute a Command

Shows 1 file while ‘-l‘ option allows command to execute in a window.

[root@localhost ~]# multitail /var/log/iptables.log -l "ping server.nixcraft.in"
Run Command and View File
Run Command and View File

6. How to Merge/View Two Files in Different Color

Merge 2 logfiles in one window, but give different color to each logfile so that you can easily understand what lines are for what logfile.

[root@localhost ~]# multitail -ci green /var/log/yum.log -ci yellow -I /var/log/mysqld.log
View Files in Color
View Files in Color

Conclusion

We’ve only covered few basic usage of multitail command. For a complete list of options and keys you can look at the man page of multitail or you may press ‘h‘ key for help while the program runs.

Root Plan
Premium Linux Education for Serious Learners

Take Your Linux Skills to the Next Level

Root members get full access to every course, certification prep track, and a growing library of hands-on Linux content — with new courses added every month.

What You Get
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA)
Access new courses on release
Get access to weekly newsletter
Priority help in comments
Private Telegram community
Connect with the Linux community
Ravi Saive
I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

6 Comments

Leave a Reply
  1. I see that while using ‘I’ switch in the last command, it overrides the log files. Using it without I switch, works fine:

    multitail -ci green /var/log/httpd/error_log -ci yellow /var/log/mysqld.log

    However, it is a great new thing for me.

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Root Plan Premium Linux Education for Serious Learners

Before You Go - Upgrade Your Linux Skills

Root members get everything in one place, with new courses added every month.

What You Get
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Linux certifications: RHCSA, RHCE, LFCS and LFCA
Access new courses on release
Weekly newsletter, priority support & Telegram community
Join Root Today and Start Learning Linux the Right Way
Structured courses, certification prep, and a community of Linux professionals - all in one membership.
Join Root Plan →
$8/mo · or $59/yr billed annually