Some CLI Tools

There are certain CLI tools that I find myself installing whenever I set up a new system. I’m not talking about the general system setup, like installing vim or Python, but some drop-in replacements for older Linux tools and some cli solutions that I use quite regularly. I thought I would collect them here for convenience. The headers are sorted alphabetically, except that “Other” is last because that seems most sensible.

Table of Contents

“Better” Drop-Ins

The following tools I use as “better” drop-ins for other commands. Instead of ls, I typically now use exa. Instead of grep, I tend to use ripgrep. Instead of find, I tend to use fd. For quick viewing of text-files with syntax highlighting, I like bat over cat. As a git/diff pager with syntax highlighting I use delta. All of these tools are written in Rust. The old df command can be improved with duf, a Go implementation with output that’s nicer to read (and alternatively, outputs as JSON).

Data and File Wrangling

Calculator

A great CLI calculator implemented in C++ is Qalculate!. It is mainly intended to be run with a Qt or GTK GUI, but does include a CLI version that can be invoked with qalc. A Rusty alternative is rink. A benefit of rink is that if you are trying to convert incompatible units, it will make a suggestion for a transformation that makes each side compatible, which can help with dimensional analysis. A good Rusty calculator app without units but wide support of operations, including functions, is kalker.

CSV and JSON

CSV files are ubiquitous, and being able to manipulate them and get an overview of what is contained without needing to actually load them in Excel/Python/SAS/etc is very useful. I used to really like csvkit for that. The main drawback here is speed for large CSV files, due to it being implemented in Python. A must faster program written in Rust is qsv, successor to BurntSushi’s xsv. It has more features than csvkit, is faster, and seems more flexible.

Another cool Python program for interacting with CSV files is visidata. It is a CSV viewer that doubles as a spreadsheet program, allows you to make plots and statistics and just do a ton of different things with your file in-memory.

The C program jq aims to be the sed of working with JSON files.

File Managers

There are a lot of file managers to choose from these days. There are lots of popular options like mc, ranger, nnn, but I tend to keep falling back on vifm.

Development

If you need to benchmark something, try Rusty old Hyperfine. There is an interesting make alternative called just, which looks promising but I haven’t played with it yet.

Resource Management

Disk Space

There are several excellent tools here. One that can be found in most repos I’ve encountered is Ncdu, a disk usage analyzer with an ncurses interface written in C. It is reasonably fast and let’s you interactively delete folders while you’re at it. A parallel implementation of the same idea but written in Go can be found with gdu. For non-interactive use, dust (du + rust) is available.

System Status - General

One of the first tools I usually install is htop. It is a widely available and fast process viewer written in C. You can use it to kill or renice a process interactively without needing to find its PID. An alternative to this is glances, “an eye on your system” written in Python. It has a lot more information, including disk usage, sensor temperatures, battery information (on laptops), etc. and can be extended with plugins. It can be used interactively on the CLI, but it also gives the option of running in client/server mode which is nifty.

Similar to glances, bottom is a Rust program giving general system information including plots, but it does not have quite the same range of information to it as glances does.

System Status - Networking

To see what is clogging up your internet pipes, try nethogs written in C++. A nice rusty alternative is bandwhich.

Other

Trying to figure out when it’s a good time to speak with a colleague in a different time zone? Install the Python package undertime.

Don’t want to remeber different package manager’s syntax? Install pacapt and use ArchLinux' pacman syntax on your system instead.

D. Michael Senter
D. Michael Senter
Research Statistician Developer

My research interests include data analytics and missing data.

Related