Credit: Glen Bowman 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: $ multitail my*.log One thing to keep in mind is that multitail is going to split the screen evenly. If you specify too many files, you will see only a few lines from each and you will only see the first seven or so of the requested files if you list too many unless you take extra steps to view the later files (see the scrolling option described below). The exact result depends on the how many lines are available in your terminal window. Press q to quit multitail and return to your normal screen view. Dividing the screen Multitail will split your terminal window vertically (i.e., left and right) if you prefer. For this, use the -s option. If you specify three files, the right side of your screen will be divided horizontally as well. With four, you’ll have four equal-sized windows. +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | | | | | | | | | | | | | | | | | | | | | | +-----------+ +-----------+-----------+ | | | | | | | | | | | | | | | | | | +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ 2 files 3 files 4 files Use multitail -s 3 file1 file2 file3 if you want to split the screen into three columns. +-------+-------+-------+ | | | | | | | | | | | | | | | | | | | | +-------+-------+-------+ 3 files with -s 3 Scrolling You can scroll up and down through displayed files, but you need to press b to bring up a selection menu and then use the up and arrow buttons to select the file you wish to scroll through. Then press the enter key. You can then scroll through the lines in an enlarged area, again using the up and down arrows. Press q when you’re done to go back to the normal view. Getting Help Pressing h in multitail will open a help menu describing some of the basic operations, though the man page provides quite a bit more information and is worth perusing if you want to learn even more about using this tool. Multitail will not likely be installed on your system by default, but using apt-get or yum should get you to an easy install. The tool provides a lot of functionality, but with its character-based display, window borders will just be strings of q‘s and x‘s. It’s a very handy when you need to keep an eye on file updates. Related content how-to How to examine files on Linux Linux provides very useful options for viewing file attributes, such as owners and permissions, as well as file content. By Sandra Henry Stocker Oct 24, 2024 6 mins Linux how-to 8 easy ways to reuse commands on Linux Typing the same command again and again can become tiresome. Here are a number of ways you can make repeating commands – or repeating commands but with some changes – a lot easier than you might expect. By Sandra Henry-Stocker Oct 15, 2024 5 mins Linux news SUSE Edge upgrade targets Kubernetes and Linux at the edge SUSE Edge 3.1 includes a new stack validation framework and an image builder tool that are aimed at improving the scalability and manageability of complex Kubernetes and Linux edge-computing deployments. By Sean Michael Kerner Oct 15, 2024 6 mins Edge Computing Linux Network Management Software how-to Lesser-known xargs command is a versatile time saver Boost your Linux command line options and simplify your work with xargs, a handy tool for a number of data manipulation tasks. By Sandra Henry Stocker Oct 11, 2024 6 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe