Compare Subfolder Sizes with du -d 1

One-line disk usage breakdown of every folder one level deep.

macOScleanupstoragedisk-spaceduLow risk
Run `du -h -d 1 <folder> | sort -hr` to list subfolders from largest to smallest.

01Command

Command
$ du -h -d 1 ~/Downloads | sort -hr

02What it does

`-d 1` limits the report to one level, so you see each subfolder’s total without thousands of lines; `-h` prints human-readable sizes and piping to `sort -hr` ranks them. Drilling down level by level is the fastest way to find what actually fills a disk.

03Risk

RiskLow risk
!Warning: du counts the space files occupy on disk, not the logical sizes Finder shows for sparse or compressed files. On folders you cannot read, sizes print as 0 — run with sudo for complete totals.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: Files & Folders

06Related solutions