Everywhere All articles Download

Command line and power tools

Seeing the shape of a folder

Updated 2026-07-31 · 3 min read

Sometimes the question is not 'where is the file' but 'what does this whole thing look like'.

Install

brew install tree

The basics

tree                    # everything below here (careful in big trees)
tree -L 2               # two levels only — the usual sweet spot
tree -d                 # directories only: the skeleton
tree -a                 # include hidden files

-L 2 -d together answer "how is this project organised" in one screen.

Useful dressings

tree -h                 # human-readable sizes beside files
tree --du -h            # folder sizes, cumulative
tree -t                 # sort by modification time
tree -I "node_modules|.git|__pycache__"    # ignore the noise
tree -P "*.swift"       # only files matching a pattern

The -I ignore list is what makes tree usable on real projects — without it, node_modules produces a scroll of thousands of lines.

As documentation

tree -L 3 -I "node_modules|.git" > STRUCTURE.txt

A tree snapshot in a README explains a repository's layout better than prose. tree -J emits JSON and -H . emits HTML, for anything that wants to consume the structure.

The built-in near-equivalent

Without Homebrew, find fakes it acceptably:

find . -maxdepth 2 -type d | sed 's|[^/]*/|  |g'

Indented, not pretty, works everywhere.

Where it fits

tree shows structure; search finds items. When a folder someone handed you is a mystery, tree -L 2 --du -h is the fastest orientation there is — the map before the treasure hunt.

Common questions

How do I limit tree's depth?

-L followed by the number of levels: tree -L 2 is usually enough to see the shape.

How do I exclude node_modules from tree?

-I with a pattern list: tree -I 'node_modules|.git'.

Find any file before you finish typing

Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.

Download for Mac

Related

© 2026 Caretopia Network Private Limited Everywhere for Mac Articles Privacy Support