Find Your Biggest Folders with du

du measures folder sizes; sorted through sort -rh and cut with head, it shows the top space consumers.

macOScleanupstoragedisk-spaceLow risk
Run `du -xsh ~/* 2>/dev/null | sort -rh | head -15` to rank everything in your home folder by size.

01Command

Command
$ du -xsh ~/* 2>/dev/null | sort -rh | head -15

02What it does

du -s gives one total per argument, -h renders sizes as GB and MB, and -x stops the walk at filesystem boundaries so network drives and backup volumes don't pollute the result. sort -rh sorts human-readable numbers descending, and head trims the list. Swap the target path to dig deeper — `du -xsh ~/Library/*` is the classic next step when hunting app leftovers. On large folders the scan takes a minute because every file must be counted.

03Risk

RiskLow risk
RequirementsAdd sudo to include folders your account cannot read; the -x flag keeps it on one filesystem.

04Undo

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

05Sources

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions