Modern Rust-based CLI tools replace classic Unix utilities with faster, friendlier, and more featureful alternatives. Tools like bat, eza, ripgrep, fd, zoxide, delta, btop, dust, fzf, hyperfine, sd, choose, procs, gping, glow, broot, lsd, and tealdeer offer syntax highlighting, Git integration, smart defaults, and visual richness that legacy tools lack. Most install via cargo, apt, brew, or pacman and can be aliased as drop-in replacements with minimal config.
What This Cheat Sheet Covers
This topic spans 20 focused tables and 322 indexed concepts, 112 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
bat β cat with Syntax Highlighting and Git Integration
| Flag / Feature | Example | Description | |
|---|---|---|---|
Basic usage | bat file.py | Display file with syntax highlighting and line numbers | |
Disable paging | bat --paging=never file.py | Print output directly without a pager | |
Plain output | bat -p file.py | β’ No decorations β’ plain text (alias mode) | |
Show line numbers | bat -n file.py | Line numbers only, no other decorations | |
Specific language | bat -l json data.txt | Force a language for syntax highlighting | |
Map extension | bat --map-syntax '*.conf:TOML' file.conf | Map unknown extension to a known syntax | |
Highlight a line | bat --highlight-line 42 file.py | Highlight specific line in output | |
Style selection | bat --style=numbers,changes file.py | Choose decoration: numbers, changes, grid, header, snip | |
Show all styles | bat --style=full file.py | All decorations enabled | |
List themes | bat --list-themes | Show all available syntax-highlight themes | |
Set theme | bat --theme="Dracula" file.py | Use a specific color theme | |
Concatenate | bat file1.py file2.py | Display multiple files in sequence | |
Alias for cat | alias cat='bat --paging=never' | Drop-in cat replacement (add to ~/.bashrc) | |
Ubuntu alias | alias bat='batcat' | Ubuntu/Debian: binary is named batcat | |
Show git changes | bat --diff file.py | Only show lines with git modifications | |
Fzf preview | fzf --preview 'bat -n --color=always {}' | Use bat as fzf file preview |