Originally deepu.tech. Published on,
Rust is taking over the terminal. Rust is a general-purpose programming language that is blazing fast and memory safe. It is the fastest growing and most loved programming language in the world. It is used to build everything from operating systems to web servers to command-line tools. Recently there has been an increase in command line tools and utilities written in Rust, and many of them are intended to replace standard Unix commands. They are faster, more user-friendly, and have more features than their standard Unix counterparts. In this post, I will cover some of the best Rust command line tools that I have used for a while. You can also use these to supercharge your terminal.
These tools are available for both Linux and macOS. I haven’t tested them on Windows, but most should work on Windows as well. I recommend aliasing the command to replace the standard command depending on your preferences. If you have the Rust package manager Cargo, you can install all of these using Cargo.
Let’s start with the terminal itself. Alacritty is a cross-platform modern terminal emulator with sensible defaults. it is GPU acceleratedSuper fast, and highly configurable. You can use it on Linux, macOS and Windows. It doesn’t have much in terms of UI, and so all configuration is done through YAML files. I don’t use it as my primary terminal because I love Yakuake for all its great features. If really needed we can get most of those features (tab, split pan, dropdown mode) using tmux and tdrop. I use Alacrity when I need speed and GPU acceleration. There is an excellent tutorial on using Alacritty with tmux.
# Arch Linux yay -S alacritty # Fedora/CentOS dnf copr enable atim/alacritty dnf install alacritty # Debian/Ubuntu add-apt-repository ppa:aslatter/ppa apt install alacritty # macOS Homebrew brew install --cask alacritty # Windows Scoop scoop bucket add extras scoop install alacritty # Cargo on any cargo install alacritty
Starship is the best terminal prompt I’ve ever used. Forget oh my zsh and stuff like that. Starship is fast, highly customizable, and has a great default themes and settings. I didn’t even change most of the default settings, because things were just perfect. Starship works on shells like zsh, fish and bash and can also work with other prompts like oh my zsh, if you still want to use other plugins like oh my zsh for autosuggest etc. Starship works best with a bold font because it can show icons and ligatures depending on the context. I used Oh My Zsh with the powerlevel10k theme for several years, but the signal was a bit slow. Starship is blazing fast with more features and excellent UX.
# Arch Linux yay -S starship # Fedora/CentOS dnf install starship # Debian/Ubuntu curl -sS https://starship.rs/install.sh | sh # macOS/Linux Homebrew brew install starship # macOS MacPorts port install starship # Windows Scoop scoop install starship # Cargo cargo install starship --locked
The bat is one of my favorite tools on this list. it is a replacement for
catand once you’ve used
bat, you’ll never go back. It provides features like syntax highlight, line number, git change highlight, show special characters, paging etc. It is super fast and looks beautiful. i have aliased
bat Immediately after trying for the first time. By default, bat behaves like this
less By paging large outputs, but this can be disabled to work exactly as
cat, It can be used as a drop-in replacement
cat Even in scripts.
bat Can also be used as a previewer of fzf. It can also be combined with many other commands and tools like
git, among others, to add syntax highlighting to the output. Syntax highlighting themes are configurable.
# Arch Linux yay -S bat # Fedora/CentOS dnf install bat # Debian/Ubuntu apt install bat # macOS/Linux Homebrew brew install bat # macOS MacPorts port install bat # Windows Scoop scoop install bat # Cargo cargo install bat --locked
LSD and AXA
LSD and AXA are both its replacements
ls command. They both look gorgeous with nice colors and markings and have features like header, sorting, tree view etc. Axa is slightly faster than LSD for tree view and can show git status of files and folders. I prefer AXA because of its Git support and faster tree views. I’ve got mine set up
ls Alias to use exe by default. Both can be configured to show custom columns and sorting behavior.
# Arch Linux yay -S exa # Fedora/CentOS dnf install exa # Debian/Ubuntu apt install exa # macOS Homebrew brew install exa # Cargo cargo install exa # Alias ls to exa alias ls='exa --git --icons --color=always --group-directories-first'
# Arch Linux yay -S lsd # Fedora/CentOS dnf install lsd # Debian/Ubuntu dpkg -i lsd_0.23.1_amd64.deb # get .deb file from https://github.com/Peltoche/lsd/releases # macOS Homebrew brew install lsd # macOS MacPorts port install lsd # Windows Scoop scop install lsd # Cargo cargo install lsd # Alias ls to lsd alias ls='lsd --header --color=always --group-directories-first'
There is an improved version of rip
rm command. It is fast, secure and user friendly. Rip sends the deleted files to a temporary location so that they can be recovered using
rip -u, I really like the simplicity and convenience of reverting, as I don’t have to worry about accidentally using something
rm, While Rip can be given an alias to replace
rmThe creators recommend not to do this because you can and do get used to it.
rm On other systems where you cannot revert the delete.
# Arch Linux yay -S rm-improved # Fedora/CentOS/Debian/Ubuntu # Install from binary or build locally using Cargo # macOS Homebrew brew install rm-improved # Cargo cargo install rm-improved
is a partial clone of xcp
cp command. It is faster and more user friendly with progress bars, parallel copy,
.gitignore support, and so on. I like its simplicity and developer experience, especially the progress bar. i have aliased
xcp So that I can use it everywhere.
# Arch Linux yay -S xcp # Fedora/CentOS/Debian/Ubuntu/macOS # Install from binary or build locally using Cargo # Cargo cargo install xcp # Alias cp to xcp alias cp='xcp'
Zoxide is a smart
cd Replacement. It remembers the directories you visit, and you can jump to them without providing the full path. You can also provide a partial path or a word from the path. When there are similar paths, zoxide provides an interactive selection using fzf. It’s super fast and works with all major shells. I like how it works, and I’ve nicknamed
z So that I can use it everywhere.
# Arch Linux yay -S zoxide # Fedora/CentOS dnf install zoxide # Debian/Ubuntu apt install zoxide # macOS/Linux Homebrew brew install zoxide # macOS MacPorts port install zoxide # Windows Scoop scoop install zoxide # Cargo cargo install zoxide --locked
Once installed, you need to add the following to your shell config file. For other shells, see the docs
# bash (~/.bashrc) eval "$(zoxide init bash)" # zsh (~/.zshrc) eval "$(zoxide init zsh)" # fish (~/.config/fish/config.fish) zoxide init fish | source # Alias cd to z alias cd='z'
dust is a substitute
du command. It is faster and has better UX with good visualization for disk usage.
# Arch Linux yay -S dust # Fedora/CentOS # Install binary from https://github.com/bootandy/dust/releases # Debian/Ubuntu deb-get install du-dust # macOS Homebrew brew install dust # macOS MacPorts port install dust # Windows Scoop scoop install dust # Cargo cargo install du-dust
ripgrep (rg) is a line-oriented search tool that repeatedly searches your current directory for regex patterns. it is faster than
grep And it has many features such as compressed files search, colored output, smart case, file type filtering, multi-threading, and so on. it understands
.gitignore files and skips hidden and unseen files. Here’s a feature comparison with other similar tools, and yes, it’s faster than all the other tools on the list.
# Arch Linux yay -S ripgrep # Fedora/CentOS dnf install ripgrep # Debian/Ubuntu apt-get install ripgrep # macOS/Linux Homebrew brew install ripgrep # macOS MacPorts port install ripgrep # Windows Scoop scoop install ripgrep # Cargo cargo install ripgrep
There is an easier alternative to fd
find, It is more intuitive to use and comes with sensible defaults. It is extremely fast due to parallel traversing and shows a modern colored output and supports patterns and regex, understands parallel commands, smart case,
.gitignore files, and so on. i have aliased
fd As I never remember what options to pass to get the original find command to work.
# Arch Linux yay -S fd # Fedora/CentOS dnf install fd-find # Debian/Ubuntu apt install fd-find # macOS Homebrew brew install fd # macOS MacPorts port install fd # Windows Scoop scoop install fd # Cargo cargo install fd-find
sd is a find-and-replace CLI, and you can use it as a replacement for
awk, It is more user friendly and modern. it is faster than the magnitude
# Arch Linux yay -S sd # Fedora/CentOS dnf install sd # Debian/Ubuntu # Install binary from the release page # macOS Homebrew brew install sd # Windows Scoop choco install sd-cli # Cargo cargo install sd
process is one
ps Replacement. It provides colorful human-readable output, multi-column search, more information than
ps, Docker support, paging, watch mode and tree view. It is much more user friendly and modern option
ps, You can filter by name and PID and use logical AND/OR operators to combine multiple filters. It also has a tree view which is very useful for viewing the process hierarchy. It can also show the docker container name for the process running the docker container.
# Arch Linux yay -S procs # Fedora/CentOS dnf install procs # Debian/Ubuntu # Install binary from the release page # macOS Homebrew brew install procs # macOS MacPorts port install procs # Windows Scoop scoop install procs # Cargo cargo install procs
below is one
top Replacement with a nice terminal UI. It is quite feature-rich and customizable.
# Arch Linux yay -S bottom # Fedora/CentOS dnf copr enable atim/bottom -y dnf install bottom # Debian/Ubuntu dpkg -i bottom_0.6.8_amd64.deb # macOS Homebrew brew install bottom # macOS MacPorts port install bottom # Windows Scoop scoop install bottom # Cargo cargo install bottom --locked
Topgrade is a great utility if you, like me, want to keep your system up-to-date. It detects most of the package managers on your system and triggers the update. It is configurable, so you can configure it to ignore certain package managers. On my system, it detected pacman, SDKMAN, Flatpak, Snap, Homebrew, rustup, Linux firmware, Pip, etc. Topgrade is cross-platform; You can use it on Windows, macOS and Linux.
# Arch Linux yay -S topgrade # Fedora/CentOS/Debian/Ubuntu/Windows # Install binary from the release page # macOS Homebrew brew install topgrade # macOS MacPorts port install topgrade # Cargo cargo install topgrade --locked
brute is one
tree option with a better user experience, and you can use it to navigate the file structure. it’s fast and respects
.gitignore, You can cd to a directory from the tree view, open sub-directories in a panel, and even preview files. It also has great keyboard navigation. It has many more features.
# Arch Linux yay -S broot # Fedora/CentOS/Debian/Ubuntu/Windows # Install binary from release page https://dystroy.org/broot/install/ # macOS Homebrew brew install broot # macOS MacPorts port install broot # Cargo cargo install broot --locked
Tokei is a nice utility for counting lines and code statistics. It’s very fast, accurate, and has good output. It supports over 150 languages and can output in JSON, YAML, CBOR and human-readable tables.
# Arch Linux yay -S tokei # Fedora/CentOS dnf install tokei # Debian/Ubuntu # Install binary from the release page # macOS Homebrew brew install tokei # macOS MacPorts port install tokei # Windows Scoop scoop install tokei # Cargo cargo install tokei
Other Notable Tools
kdash: A fast and simple dashboard for Kubernetes. It’s made by me 🙂
xh: An HTTPie alternative with better performance.
monolith: Convert any webpage into an HTML file with all assets inline.
Delta: A syntax-highlighting pager for git, diff, and grep output.
ripsecrets: Find the secret key in your code before committing to git.
Eva: A CLI REPL calculator.
- You can find a list of other Rust CLI tools here
If you liked this article, please like or comment on it.
you can follow me Twitter and LinkedIn.
cover image credit: created by agonelbre/gopher Image from work at @egonelbre,