Modern Replacements for tree

Tools you can run instead of tree: eza, erdtree, lsd and broot compared by tree output, gitignore handling, flags and config.

Updated

short verdict

Pick eza if you want a tree mode inside an ls replacement, with Git status and depth limiting. Pick erdtree if you want a tree that shows disk usage and skips gitignored files by default. Use lsd if you want tree output with icons and an alias, and broot if you want to browse and act on the tree interactively.

tree prints a directory hierarchy and little else. The tools here cover the same job but differ in where the tree lives: a display mode of an ls replacement (eza, lsd), a disk usage analyzer with tree output (erdtree), or an interactive navigator (broot). The differences that matter are gitignore handling, size reporting, depth control and whether the output is a static printout or a UI.

this page is for

  • Developers who want tree output that respects .gitignore
  • People who already use an ls replacement and want its tree mode
  • Anyone who wants sizes or line counts next to the tree
  • Users who would rather navigate a large tree than print it
#1

eza

★ 23.7kRust
details

An ls replacement written in Rust whose tree view supports depth limiting, glob-based exclusion and Git status next to each file.

best for

  • Users who want one tool for ls and tree
  • Repos where Git status in the listing helps

strengths

  • Tree is one of its display modes, next to grid and long views
  • Recursive traversal with depth limiting and glob patterns for excluding files
  • Shows Git file status and repository information alongside metadata
  • Configurable color themes through YAML files, plus icons and terminal hyperlinks

weaknesses

  • Tree is a mode of an ls-style tool, and compatibility with tree's own flags is not documented
  • No disk usage or line-count metrics are documented for the tree
#2

erdtree

★ 2.6k
details

A multi-threaded tool that combines du, tree, find, wc and ls, and ignores gitignored and hidden files by default.

best for

  • Finding what takes up space in a project tree
  • Trees that should skip gitignored files without extra flags

strengths

  • Respects .gitignore and hidden file rules by default
  • Sizes by logical or physical bytes, blocks, word count or line count
  • Layouts: regular tree, inverted tree and flat du-like output
  • Regex and glob search, TOML config for defaults, shell completions for bash, fish and zsh

weaknesses

  • Covers more than tree, so it carries a larger option surface for a simple listing
  • Language and license are not documented by the project
#3

lsd

★ 16.3kRust
details

A Rust rewrite of GNU ls where `lsd --tree` prints a tree with colors and file type icons.

best for

  • Users who want icons in tree output
  • Anyone who wants a one-line alias such as lt for tree view

strengths

  • Tree view through the --tree flag
  • Colors and icons customizable in config.yaml, colors.yaml and icons.yaml in the XDG config directory
  • Available through Homebrew, Cargo and APT
  • Icon overrides by name, extension or filetype

weaknesses

  • Icons need a patched font such as Nerd Font or Font Awesome
  • No documented disk usage metrics or gitignore-aware filtering
#4

broot

★ 13.1kRust
details

An interactive terminal file manager that shows a compact tree, filters it by fuzzy search and respects .gitignore.

best for

  • Exploring large directories instead of printing them
  • Moving, copying or deleting files while keeping the tree in view

strengths

  • Fuzzy search, `/pattern` regex search and `c/pattern` content search
  • Git commands: `:gf` for file statuses and `:gs` for changed files only
  • Sorting with --sort-by-size and --sort-by-date
  • Multiple panels, file previews and a staging area for batch operations

weaknesses

  • Interactive UI rather than a static printout, so it is a poor fit for piping into other commands
  • Image previews depend on a compatible terminal

What changes compared to tree

  • erdtree skips gitignored and hidden files by default; broot also respects .gitignore
  • erdtree can report logical bytes, physical bytes, blocks, word count or line count per entry
  • erdtree offers regular, inverted and flat du-like layouts; eza and lsd add a tree mode to ls-style output
  • eza shows Git status per file; broot adds `:gf` and `:gs` for Git views
  • lsd and eza can show icons, and lsd needs a patched font for them

Switching from tree

The documented migration steps are small: an alias for lsd and a config file for erdtree.

  • lsd: `alias lt='lsd --tree'` gives a tree command
  • lsd: `alias ls='lsd'` and `alias lla='lsd -la'` cover ls habits
  • erdtree: set your usual defaults in its TOML configuration file
  • erdtree: install shell completions for bash, fish or zsh

When not to use these

  • You need identical tree output and flags for existing scripts: none of these tools documents tree flag compatibility.
  • You only need a tree on a minimal server where you cannot install extra binaries.

Also worth a look

  • exaThe predecessor of eza with a tree view and Git support, but it is no longer maintained; the project recommends eza.

FAQ

Can these tools be used as drop-in replacements for tree in scripts?
This is not documented. None of the projects states that it accepts tree's flags or reproduces its output format, so test your script's output before switching. The one documented shortcut is lsd's `alias lt='lsd --tree'`, which is a shell alias rather than a flag-compatible command.
Which replacement ignores gitignored files by default?
erdtree respects .gitignore and hidden file rules by default. broot also respects .gitignore files. eza documents Git integration and glob-based exclusion, but default gitignore filtering is not documented.
Can I see file sizes or line counts in the tree?
erdtree reports disk usage as logical or physical bytes, blocks, word count or line count. broot can sort by size with --sort-by-size.
Should I still use exa?
No. exa is no longer maintained, and its project recommends eza, the fork, instead.

related