Upgrade some of your daily tools
One of the main purposes the community gave for Rust as it started to get traction was the recreation of some of the more popular command line tools. It’s easy to grasp the reason for this as soon as you develop your first command line app with Rust. The combination of a low-level language with crates like clap, structopt, or console and the easiness of publishing and installing the crates with cargo makes the development of this type of software a pleasure.
Today, we’ll see five command-line tools rewritten in Rust that will catch your eye with the improvements they bring to the table.
What is the only thing better than a cat? A bat. Well, maybe not, at the least if we are talking about mammals (I still do love bats, though), but in the context of a terminal, I have a point to prefer
bat is a command intended for the same as the UNIX built-in
cat, but it features syntax highlighting and integrates with git showing the differences of the files. So, for developers like us, this is a nice improvement to a very common tool.
bat, you can follow their README or just go the Rustacean way.
cargo install bat
ripgrep is FAST, like, blazingly fast. That’s the best description I can make of it. Based on the name alone, you can see what this crate accomplishes: substitute
grep. These are big words, as
grep is an incredibly handy tool of UNIX to search text recursively, but ripgrep is the same but FASTER.
It was first started by Andrew Gallant and features more than 300 contributors on its GitHub page. It supports a lot of encodings, can be case sensitive or not, follows .gitignores content, and a lot more. Look at some benchmarks its creator offers to know what I’m talking about.
cargo install ripgrep
grep based on speed, dust became an alternative for
du focusing on brevity, commodity, and visualization. If you have used
du in the past, you already know that the command is a synonym for extensive folder logging and messages about missing permissions.
dust, on the other hand, it will yield you a terminal height-based result with the tree of folders and even a graph displaying the disk usage visually. A single
dust call usually gives all the information you need without the burden of adding flags or getting your terminal drowned in lines of text.
cargo install du-dust
dust was already a nice jump in terms of data visualization in comparison with
du, what bottom accomplishes is even wilder. To the point that I won’t say anything about it and will just let the images take care of selling this awesome tool to you.
You can get guides for installation and usage on their webpage.
cargo install bottom
Finally, to close this article, we’ll be glaring at the king of UNIX only next to
cd, the all-mighty
ls. Very few commands do we write more than the good ol’
ls, to the point that oh my zsh already comes with a lot of aliases to write it even faster, like
This last case is the only one where I didn’t swap to the new modern tool, but exa can be very useful with its extra features like the colouring for the different types of files or its compatibility with Git.
As with all the others, you can find the instructions on the README of the tool or go with cargo.
cargo install exa
And that’s all. I hope you liked it and found some new tools to use daily. See you soon!