10 Must‑Have Linux CLI Alternatives to Boost Your Productivity
Discover ten powerful Linux command‑line replacements—including bat, duf, tldr, htop, glances, exa, fd, ag, axel, and pydf—detailing installation across major distributions, core features, usage examples, and customization tips to enhance file viewing, system monitoring, searching, and downloading efficiency.
Introduction
On Linux, the cat command is frequently used to concatenate files and output them to the terminal. A modern alternative called bat provides syntax highlighting, Git integration, and automatic paging, making file inspection more readable.
Installing bat
Arch Linux: pacman -S bat Fedora: dnf install bat macOS (Homebrew): brew install bat Ubuntu 21.10 (deb package):
sudo apt-get install wget
wget https://github.com/sharkdp/bat/releases/download/v0.18.3/bat_0.18.3_amd64.deb
sudo dpkg -i bat_0.18.3_amd64.debOther distributions may require building from source or using the GitHub release page.
Using bat
Basic usage mirrors cat:
bat > jiaoben1.sh bat jiaoben1.sh bat jiaoben1.sh jiaoben2.sh bat jiaoben1.sh jiaoben2.sh > test.txtAdding -n shows line numbers without the table grid.
bat -n jiaoben2.sh batalso integrates with Git to display changes and can automatically pipe output to less for paging.
Custom Themes
Run bat --list-themes to view the 24 built‑in themes. To apply a theme, use bat --theme=Dracula file or set the environment variable export BAT_THEME="Dracula" for a permanent change. The --style option lets you control line numbers, file headers, grid borders, and Git changes (e.g., --style=numbers,changes).
Further details are available via man bat or bat --help, and the project’s GitHub repository.
duf – A Better Disk‑Usage Viewer
dufis a cross‑platform tool written in Go that presents disk usage in a colorful, categorized table, supporting Linux, Windows, macOS, Android, and FreeBSD.
Installation
Ubuntu:
sudo apt install gdebi
sudo gdebi duf_0.5.0_linux_amd64.debmacOS (Homebrew): brew install duf Windows (Chocolatey): choco install duf or scoop install duf Running duf without arguments lists all local and mounted devices. Useful flags include: --only local – show only local devices --sort size – sort output by size --json – output in JSON format --theme light – force a light theme
tldr – Simplified Man Pages
tldr(Too Long; Didn’t Read) provides concise examples for common commands. Install via Node.js on Ubuntu:
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm -g install tldr
tldr --updateUsage is simply tldr <em>command</em>, which displays short examples with syntax highlighting.
htop – Interactive Process Monitor
htopis a C‑based, cross‑platform replacement for top with a richer UI, mouse support, and easy process management. Install with:
apt install htopglances – Comprehensive System Monitor
Written in Python, glances offers a curses or web UI, showing CPU, memory, network, disk usage, sensors, and the most resource‑intensive processes. It can run in client/server mode and export data via JSON or to external databases.
exa – Modern ls Replacement
exaadds colors, grid view, tree view, Git status, extended attributes, and flexible sorting. Install on Ubuntu 21.10: apt install exa Common options:
-1, --oneline -G, --grid -l, --long -R, --recurse -T, --tree --iconsfd – User‑Friendly find Alternative
fdis a fast, color‑aware search tool that respects .gitignore and skips hidden directories by default. Install on Ubuntu: sudo apt install fd-find Because the binary is named fdfind, create an alias: alias fd=fdfind Example searches:
fd *.md fd -H "pattern" # include hidden filesag – The Silver Searcher
ag(and its predecessor ack) provide faster recursive text search than grep, with highlighted matches and file names. Install on Ubuntu 21.10:
apt-get install silversearcher-ag
apt install ackCommon flags: -g – list matching file names -i – case‑insensitive -A, -B, -C – show context lines -w – match whole words
axel – Multi‑Threaded Downloader
axelspeeds up downloads by using multiple connections. Install on Ubuntu: apt-get install axel Example:
# axel -n 10 -o /tmp/ https://mirrors.163.com/ubuntu/ls-lR.gzpydf – Pretty df Output
pydfpresents disk usage in a concise, colored table. Install on Ubuntu 21.10: apt install pydf It replaces the traditional df output with a more readable format.
References
bat : https://github.com/sharkdp/bat
duf : https://github.com/muesli/duf
tldr : https://github.com/tldr-pages/tldr
htop : https://github.com/htop-dev/htop
glances : https://github.com/nicolargo/glances
exa : https://github.com/ogham/exa
fd : https://github.com/sharkdp/fd/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
