Simplifying and improving standard commands
Command-Line – New Commands
![© Lead Image by Andras Vas on Unsplash © Lead Image by Andras Vas on Unsplash](/var/linux_magazin/storage/images/issues/2019/222/command-line-new-commands/photobyandras-vas-on-unsplash-command-key.png/746131-1-eng-US/Photobyandras-vas-on-unsplash-Command-Key.png_medium.png)
© Lead Image by Andras Vas on Unsplash
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.
The more basic a command is, the more likely it is to predate Linux. The long history of commands is an advantage in that core commands have had more than four decades to get the bugs out and to make revisions as the expectations and needs of Linux users have evolved. However, more options can also make mastering commands more difficult. At times, all the revisions can make learning and remembering commands absolutely cumbersome.
Rather than completely restructure basic commands, Linux programmers have often responded by writing completely new commands that are either rationalizations or simplified front ends for older commands. Being as set in my ways as most people, initially, I have often been skeptical of these new commands. Yet when I tally them up, I find that I have replaced standard commands with newer ones in a surprising number of cases. Here are seven leading examples.
tree
Few commands are as basic as ls
. When working from the command line, you can use it a dozen times in an hour to list the contents of a directory.
tree
(Figure 1), which replaces ls
, shares many of the same options, but with one important difference: tree
displays the contents of a directory in a tree view, similar to the one in a file manager. That may sound like a minor difference, but a visualization is always welcome, especially in these desktop-oriented days.
By default, tree
displays the current directory. However, you can also specify a top directory after the command options. Usefully, archived files are treated as directories, so their content can be viewed directly and without another command.
If you want more information, you can set tree
to list file attributes and include hidden files. If you want less, you can show only directories and omit blank directories. Essentially, tree
does everything ls
does – even color-coding by setting color-coding variables – while also providing an additional bag of small enhancements.
multitail
tail
is a standard command used by administrators to keep an eye on the most recent lines in logs and other files that change frequently. As the name implies, its replacement multitail
(Figure 2) allows multiple files to be monitored with the same command, saving both effort and system resources.
Like tail
, multitail
can set the number of lines to display, as well as the interval between samples. In addition, multitail
can be set to mark set intervals in which nothing happened with an x, or to replace repetitions of the same line with a message stating how many times it has been repeated. Similarly, multitail
includes options for which windows present the output, including the option to merge all output from all files in the same window. Windows that are inactive for a defined interval can be set to close automatically, and output can be sent to a file or to another command.
One especially useful feature is the ability to use regular expressions. When regular expressions are defined, an entire directory can be monitored at the same time, with messages appearing only when a file has changed. Color and column formatting options are also available – all of which is considerably more sophisticated than tail
with its handful of commands.
pax
Over the years, Linux has accumulated a bewildering set of formats for file compression (bzip2
, gzip
, tar
, etc.). Each format has its own options, although some are more closely related than others. The pax
command cuts through this confusion by offering a single interface for over half a dozen formats (Figure 3). The main difficulty is that while some formats like tar
use the option -x FORMAT
, other formats like bzip2
have their own options, probably because support for them was added afterwards. Most users, too, will be surprised to learn that there are three different tar
formats from which to chose. However, because format is only one option among others, pax
spares users having to scan man pages when dealing with unfamiliar formats.
pax
's other options are not as complete as those for single format commands, but they are adequate enough for most purposes. Files can be appended to existing archives, and the contents of an archive can be defined by several criteria, such as file or block sizes, or a range of dates to include or exclude. Other options specify what file attributes to use. Overall, pax
is a major simplification of archiving options.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
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](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.