Home / Linux / Using multitail on Linux | Network World

Using multitail on Linux | Network World

The multitail command can be very helpful whenever you want to watch activity on a number of files at the same time – especially log files. It works like a multi-windowed tail -f command. That is, it displays the bottoms of files and new lines as they are being added. While easy to use in general, multitail does provide some command-line and interactive options that you should be aware of before you start to use it routinely.

Basic multitail-ing

The simplest use of multitail is to list the names of the files that you wish to watch on the command line. This command splits the screen horizontally (i.e., top and bottom), displaying the bottom of each of the files along with updates.

$ multitail /var/log/syslog /var/log/dmesg

The display will be split like this:

|                       |
|                       |
|                       |
|                       |

The lines displayed from each of the files would be followed by a single line per file that includes the assigned file number (starting with 00), the file name, the file size, and the date and time the most recent content was added. Each of the files will be allotted half the space available regardless of its size or activity. For example:

content lines from my1.log
more content
more lines 00] my1.log 59KB - 2019/10/14 12:12:09 content lines from my2.log more content
more lines 01] my2.log 120KB - 2019/10/14 14:22:29

Note that multitail will not complain if you ask it to display non-text files or files that you have no permission to view; you just won’t see the contents.

You can also use wild cards to specify the files that you want to watch:

>> Source Link


Check Also

Pocket PC handheld Linux computer coming in 2020 for $199 and up (maybe – crowdfunding)

Sure, there’s a chance you could turn your old smartphone into a pocket-sized Linux computer …