Interesting Alternatives to Some of the Classic Linux Commands

Legacy commands were created several decades ago and while they do their intended jobs, their functionalities could be improved and the structure could be simplified.

This is why there exist ‘alternative’ tools that enhance the legacy UNIX/Linux commands. In this article, I am going to list some new CLI tools that you could use in place of the good old classic Linux commands.

HTTPie: Alternative to wget and curl

When it comes to downloading files in terminal, wget and curl are the two of the most common tools. Interestingly, not all distributions have curl, wget installed by default.

HTTPie does the same job but in a more human-friendly way. You have colorized, the formatted output which makes it easier to understand and debug.

Bat: Alternative to cat

The cat command is perhaps one of the first commands you learn. It does the job for viewing the contents of small text files.

But bat command takes it to the next level by adding features like syntax highlighting and Git integration. The pagination option is also available.

ncdu: Alternative to du command

The du command in Linux is used for checking the size of a directory. It’s not very straightforward command and it certainly doesn’t give a very good default output.

Compared to that, ncdu is a lot better than providing the relevant information at the first glance.

There are other features here such as showing the disk usage in graphs, sort the display and even delete directories interactively.It is based on ncurses and hence the ‘nc’ is added to ‘du’. A similar CLI tool is gdu which is a du replacement written in Go which gives it a performance boost.

fd: Alternative to the find command

The find command is one of the most powerful and most used Linux commands. It’s impossible to imagine that a sysadmin could survive without using the find command.

But the find command has a strange structure and it could be slow if you do a large set of find operations. A better and faster alternative is fd command. Written in Rust, fd is simpler and faster than its legacy competitor.

exa: Alternative to ls command

The exa CLI tool adds a few features while listing directory contents. It has better defaults and uses colors to distinguish file types and metadata. exa can also display a file’s extended attributes, as well as standard filesystem information such as the inode, the number of blocks, and a file’s various dates and times.

You can use the tree view to see directory structure. It also has built-in Git support to see what files have changed, committed and staged etc.

Duf: Alternative to the df command

The df command in Linux is used for checking disk space. While it works most of the time, an easier and better alternative is duf, a tool written in Go.

It gives you an overview of all the devices mounted which is easy to understand. You also have the ability to specify a directory/file name and check free space for that mount point.

With duf, you can sort the output, list indoe information and even save the output in JSON format.