Introduction
ls is 50 years old and shows its age: cryptic colors, no icons, no git integration, awkward -h --size=K dance. lsd modernizes it by keeping ls's flag compatibility while adding icons (when a Nerd Font is installed), smart coloring, tree view, and per-file-type icons — all in a fast Rust binary.
What lsd Does
- Lists directories with icons, colors, permission, size, date.
--treeprints a full directory tree with depth limits.--blockslets you pick which columns to display.- Preserves most GNU
lsflags (-la,-S,-t,-r). - Respects
.gitignorewhen combined with other tools.
Architecture Overview
lsd wraps the standard libc stat and readdir calls, maps file extensions to icons via a bundled table, and colors output based on type using crossterm. Sort, filter, and tree logic live in a single Rust pipeline for predictable performance on large directories.
Self-Hosting & Configuration
- Install via brew, cargo, apt, dnf, pacman, scoop.
- Config file
~/.config/lsd/config.yamlsets default columns, date format, indent width. - Icon theme
~/.config/lsd/icons.yamlmaps extensions → glyphs. - Color theme
~/.config/lsd/colors.yaml. - Needs a Nerd Font in terminal for icons.
Key Features
- GNU ls compat — muscle memory transfers.
- Per-extension icons.
- Tree mode without installing
tree. - Configurable columns — size-first, date-first, etc.
- Portable: Linux, macOS, Windows (PowerShell/WT).
Comparison with Similar Tools
- eza (exa fork) — also Rust; slightly broader feature set (git-aware columns).
- ls — POSIX default.
- tree — dedicated tree viewer; lsd covers both.
- nnn/ranger — interactive file managers, different use case.
- bat — pager for files; complementary.
FAQ
Q: No icons showing? A: Install a Nerd Font (Hack, JetBrainsMono NF, Fira Code NF) and set it in the terminal.
Q: Git indicators?
A: --blocks git column.
Q: Windows support? A: Yes, via scoop/winget; Windows Terminal recommended.
Q: Customize colors?
A: Edit ~/.config/lsd/colors.yaml.