The Linux tree Command: Directory Tree Visualization
tree displays directory hierarchies in a tree format - much nicer than recursive ls.
Basic Usage
tree
tree /path/to/dirShow directory tree.
Options
-L N— Limit depth to N levels-d— Directories only-a— Include hidden files-I pattern— Exclude pattern-f— Print full path prefix-s— Print sizes
Examples
Limit depth
tree -L 22 levels deep.
Directories only
tree -dShow folders only.
Exclude patterns
tree -I 'node_modules|dist'Ignore build directories.
