ncdu — NCurses Disk Usage — is du with an interface. The question "what is eating this disk?" becomes an interactive drill-down: arrow keys move, enter descends, d deletes, and the biggest directories sort themselves to the top. It is the rare tool that is both faster to use and easier to learn than its classic counterpart.

The drill-down #

Scan a directory tree
$ ncdu ~

The listing sorts by size, largest first, with a relative bar beside each entry. You follow the numbers down: 54G total, 18G projects, 12G .cache — three keystrokes to the culprit, where the du-plus-sort pipeline needs a command per level.

Deleting happens inside the tool — d on an entry, confirm, done. Every deletion is explicit; ncdu never removes anything you did not point at.

The flags worth knowing #

FlagEffect
-rRead-only mode: browse without delete keys
-xStay on one filesystem (skip mounted drives)
-eShow extended info including permissions
-o fileExport a scan to analyse later
-f fileImport a previous export

-x matters on home directories full of bind mounts and network shares — you scan what you meant to scan. The export/import pair is quietly excellent for servers: scan once (as root, over ssh), then browse the dump locally without re-walking the tree:

Scan remotely, browse locally
$ ssh server 'ncdu -o - /var' > server-var.ncdu
$ ncdu -f server-var.ncdu

Where it sits in the workflow #

The full diagnostic stack, in order:

  1. df -h — is the filesystem actually full?
  2. ncdu — which directory is responsible?
  3. rm or archive — the rm habits apply, just with better aim.

Cleaning up what ncdu finds safely is rm territory; archiving instead of deleting is tar. The terminal notes series continues on the journal.