Custom file monitoring

Command Line – tail

© Lead Image photo by Andre Mouton on Unsplash

© Lead Image photo by Andre Mouton on Unsplash

Article from Issue 223/2019
Author(s):

When it comes to file monitoring, tail's replacements, colortail and MultiTail, offer more sophisticated control over how your information is displayed.

Pagers are a basic necessity for administering a system. That necessity is especially strong in Linux, where configuration settings are stored in text files. The best-known pagers, of course, are cat, less, and more, all of which present the entire contents of a file. However, if you want to monitor a file over time, such as the logs in /var/log or /tmp, the required tool is one that displays the lines at the end of the file, where new information is appended. The original tool for this purpose is tail, but, these days, it is increasingly being replaced by colortail or MultiTail. All these commands share the same basic functionality, but the replacements offer more control over how information is displayed (Figure 1).

Figure 1: The tail family is especially useful for monitoring the system logs found in /var/log.

tail and colortail

The original command, of course, is tail [1] (not to be confused with Tails Linux, which is used for secure browsing). By default, tail displays the last 10 lines of a file that it is monitoring. However, you can use

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Command Line: MultiTail

    MultiTail is not only more powerful than Tail, it's also easier to use.

  • Logfile Viewers

    While users are surfing the web, listening to music, and writing documents, the kernel and various background daemons write information to logfiles. KSystemLog, Gnome System Log Viewer, and MultiTail will help you read and process logfile data.

  • Five lean tools for monitoring logfiles

    Anyone wanting to monitor logfiles could use one of the big dogs like Nagios or Icinga. However, lightweight alternatives can also sniff out threats and take much less time to set up. We put five of these little guard dogs to the test.

  • New Commands for Old Purposes

    As the standard core Linux commands have become more complex due to revisions, new commands have risen to take their place. Bruce looks at seven of these modern commands, plus a terminal emulator.

  • Command Line: File Viewers

    Practical tools such as cat, less, and head are convenient for viewing text.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News