My Favorite Command Line Tools
Over the course of years using the command line, I've found some handy tools. This list is to remember everything I've collected thus far.
A cat(1) clone with syntax highlighting and Git integration.
cat is one of the most useful tools of the command line and
bat just brings it into the modern era with syntax higlighting and some other neat tidbits. Just alias
bat and don't look back. My only recommendation would be to make line numbers not present by default!
A command-line benchmarking tool.
time is a pretty good tool that most people are familiar with but I came across
hyperfine while looking for ways to compare API requests to Stripe's API and couldn't be happier. It's written in Rust and has some very convenient output formats.
mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool.
An amazing tool to do some network diagnostics and see where things might be going wrong. Has been effective in the past for identifying where exactly in the chain of nodes things might be going wrong. Has allowed me to answer the question, "is my current predicament due to something I have done to my home network?" time after time.
ncdu is a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don't have an entire graphical setup available, but it is a useful tool even on regular desktop systems. Ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.
Very useful tool for drilling into what is taking up space. I used DaisyDisk for an annoyingly long time longing for the same experience as WinDirStat on Mac.
ncdu has become my main tool for figuring out space issues or unexpected directory growth on any of my machines.
restic is a backup program that is fast, efficient and secure.
I have two datasets that would be horrible to lose:
- A lifelong repository of pictures
- A lifelong repository of documents of all varieties.
I realized that for both of these repos, they were stored in exactly one place and one place alone which does not follow the very helpful 3-2-1 backup strategy. I was also putting all my faith in Google which probably never cause me any issues, but with files so important, is that enough? Certainly not.
So, in a weekend I was able to set up
restic and automate the process of backing up all these files to both Backblaze B2 storage and an offsite & off-continent Raspberry Pi with an external SSD. Now I have a few layers of resilience when it comes to my storage failing and/or losing access to my Google account.
xsv is a command line program for indexing, slicing, analyzing, splitting and joining CSV files. Commands should be simple, fast and composable:
- Simple tasks should be easy.
- Performance trade offs should be exposed in the CLI interface.
- Composition should not come at the expense of performance.
I recently needed to scrape a website and output different values on a page into a CSV for easier consumption by other people at work. The biggest hassle is of course taking multiline strings and putting them into a csv file. On every iteration of my script, I started by opening up Numbers (😵) and examining the result but that became very onerous. With
xsv's nicely formatted command line output I could rerun my extraction script and then verify the csv output without leaving the command line.
10/10 would use this to csv again.