
eza: How to Show a Tree
Updated
Learn how to display directory trees with depth limits, icons, and Git status using eza

Before we start, make sure you have eza installed on your computer. If you don't have it yet, install it with Homebrew:
brew install eza
Print a Basic Directory Tree
Open your terminal, navigate to your project folder, and run eza --tree (or the short flag eza -T) to display the directory structure as a tree:
eza --tree
Useful Tree Combinations
In larger projects, limit the depth with --level (or -L) so your terminal doesn't get flooded:
eza -T --level=2
Combine -a and --icons to include hidden files and file icons, or add -l and --git to see permissions, sizes, and repository status right beside the tree:
eza -Ta --icons
eza -Tl --git
You can also target a specific folder by appending its path like eza -T /path/to/directory, and exclude noisy folders with -I:
eza -T -I "node_modules|.git"
If you use the tree view often, combine your favorite flags into a shortcut alias like alias lt='eza -T --level=2 --icons=auto -I "node_modules|.git"' in ~/.zshrc.
