tree
The original recursive directory lister — still the fastest way to paste a project layout into a document.
What it does
tree walks a directory and prints it as an ASCII tree. Useful flags:
tree -L 2 # depth limit
tree -a -I 'node_modules|.git' # show hidden, ignore patterns
tree -d # directories only
tree -H . -o index.html # HTML outputNotes
Worth keeping even with lsd --tree available: tree’s output format is stable and scriptable, documentation and READMEs quote tree -L 2 verbatim, and it needs no special font.
Alternative to
| Alternative | Type | Trade-off |
|---|---|---|
| eza –tree or lsd –tree | Open source | The same view from a tool you may already have |
| broot | Open source | An interactive tree that can navigate and act, not just print |
find | Built in | No tree drawing, but it is everywhere and it composes |
Install
brew install tree