tree

Show a directory tree

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Prints directories and files as an indented tree. Useful for understanding project layouts.

Common flags
FlagMeaning
-LLimit depth to N levels
-aInclude hidden files
-dDirectories only
-IExclude entries matching a pattern
-hHuman-readable sizes
Examples
tree -L 2Two levels deep · explain & risk-check →
tree -a -I ".git|node_modules"Include dotfiles but skip noise · explain & risk-check →
Pro tip

Use -L on large trees — an unbounded tree of / floods the terminal.

Related
ls find du
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man tree for your version. Test destructive commands on a non-production system first.