How to get multicolored output when watching a file with Linux.

Posted: November 8, 2017. At: 11:16 AM. This was 2 months ago. Post ID: 11517
Page permalink.
WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters. These cookies expire two weeks after they are set.

The tail command is a good way to see new content in a file, but it is monochrome output. But there is a better way to monitor files. Use the multitail command instead. This will print muticolored output when printing the last few lines of a file.

Install this utility.

sudo apt install multitail

Then run it to get the newest content in a file.

multitail -c /var/log/dpkg.log

Below is the output this utility gives you. Very useful for monitoring a logfile for new activity. This will automatically update when the file is updated. Perfect to run in a spare xterm window to monitor a server.

The multitail utility in action.
The multitail utility in action. This shows the recent installation of the gentoo file manager.

Therefore, this is the best approach for watching an important logfile on Linux.

Running it like this will allow the user to monitor two files at once, this is also very useful.

multitail -u 5 -c /var/log/dpkg.log /var/log/syslog

No comments have been made. Use this form to start the conversation :)

Leave a Reply