ncdu
Scans a directory tree and lets you browse it sorted by size, in a terminal.
What it does
ncdu scans a path, then presents it as an interactive list sorted largest-first. Arrow keys navigate in and out, d deletes, and the totals update. It runs over SSH, which is what makes it the right tool for a full disk on a headless server.
ncdu /
ncdu -x / # stay on one filesystem
ncdu -o scan.json / # save a scan
ncdu -f scan.json # browse it laterNotes
sudo is needed to see other users’ and system directories. -x is almost always wanted on macOS, otherwise it wanders into mounted volumes and network shares.
Alternative to
| Alternative | Type | Trade-off |
|---|---|---|
| dust | Open source | A friendlier du with a bar chart, no interactive browsing |
| gdu | Open source | Considerably faster on SSDs, same interface idea |
| dua-cli | Open source | Parallel scanning with an interactive mode |
du -sh * | sort -h | Built in | No install, and enough surprisingly often |
Install
brew install ncdu