repobenchmarks // cli productivity
PRODUCTIVITY
$ eza --tree --git --icons && bat app.py

bat & eza Rust Utilities

Supercharge daily shell workflows with automatic syntax highlighting, inline Git diff indicators, and tree exploration.

Replaces: cat & ls Features: Git Status & Colors Performance: Pure Rust
. ├── src/ │ ├── main.rs [+M] │ └── lib.rs [-] └── Cargo.toml [untracked] ✓ eza git integration

The standard Unix utilities cat and ls were designed over 50 years ago for teleprinters and low-bandwidth serial lines. While ubiquitous, they lack syntax highlighting, Git repository awareness, and modern directory visualization. The modern command-line renaissance has produced two indispensable Rust-powered replacements: bat (a cat clone with syntax highlighting and Git integration) and eza (the maintained, high-performance successor to exa).

bat & eza Terminal Enhancement Pipeline Diagram showing how bat handles syntect syntax parsing and git diff checking while eza queries file metadata and git index simultaneously. bat Architecture (cat replacement) Syntect Sublime-Syntax Parser Git Gutter Modifications (libgit2) Automatic Pager Routing via less eza Architecture (ls replacement) Parallel Metadata & Inode Querying Recursive Tree View & Git Status Flags Nerd Font Glyph & Color Grading
Figure 1: Internal execution pipelines of bat and eza showing integrated Git state detection and syntax rendering.

Why Developers Alias bat and eza

  • bat: Beyond syntax highlighting for over 200 programming languages, bat displays line numbers, highlights git additions/modifications in the gutter, and automatically pages long files through less while preserving terminal pipe transparency when output is redirected.
  • eza: Adds multi-column color formatting, human-readable file sizes, symlink resolution, full recursive tree listing (replacing the separate tree utility), and displays real-time Git status flags (staged, modified, untracked) next to each file.

Tool Capability Comparison Matrix

Capability bat vs cat eza vs ls
Syntax Highlighting Yes (syntect engine) vs None N/A
Git Status Integration Gutter indicators for modified lines Displays modified/staged/untracked flags
Recursive Tree View N/A Built-in --tree with depth limits
Pipe Transparency Disables formatting automatically when piped Falls back to plain text when not a TTY

Recommended Shell Aliases

Add these aliases to your ~/.zshrc or ~/.bashrc:

# Replace ls with eza
alias ls="eza --icons --group-directories-first"
alias ll="eza -lh --icons --git --group-directories-first"
alias lt="eza --tree --level=2 --icons"

# Replace cat with bat
alias cat="bat --paging=never"
alias preview="bat"
✓ Installation & Package Binary Names
  • Ubuntu/Debian batcat Quirk: On Debian and Ubuntu, the bat package installs as batcat due to a name conflict with another package. Create a symlink: mkdir -p ~/.local/bin && ln -s /usr/bin/batcat ~/.local/bin/bat.
  • Install eza: On macOS run brew install eza bat. On Ubuntu, use the official GPG repository from eza-community/eza.

Conclusion

Replacing legacy POSIX defaults with bat and eza provides immediate visual clarity, reduces cognitive load, and transforms everyday terminal file inspection.

// Primary Sources & Documentation
Editorial Note: CLI parameters verified against bat v0.24+ and eza v0.20+ releases on Linux and macOS.