Show Folder Sizes Sorted with du -sh
Rank every folder by disk usage, biggest last, in human-readable units.
Run du -sh */ | sort -h to list each folder's size from smallest to largest.
01Command
Command
$ du -sh */ | sort -h02What it does
du -sh * alone lists sizes but in arbitrary order; piping through sort -h understands the K/M/G suffixes so the giant folder lands at the bottom. Note that folders you lack permission to read report zeros — re-run with sudo for the true total. For just the top offender, add | tail -5.
03Risk
!Warning: First run on a huge folder can take a while; the sizes also include hidden files that Finder ignores.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- du – Estimate file space usageEvidence: du -sh gives a human-readable total per argument; sort -h sorts those sizes correctly (2K < 1M < 3G).
Last verified: 2026-09-18 · Category: Files & Folders
06Related solutions
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.
Show file extensions for all files on Mac
Make Finder display .pdf, .docx, .png and every other extension at all times.
Find Which Process Has a File or Volume Open with lsof
List every open file descriptor — files, directories, and network sockets — per process.