ncdu

Browse disk usage interactively and delete from the tree

About

ncdu scans a directory and presents the result as a navigable tree with sizes, so you can drill into whatever is taking space. You can delete files from inside it, which makes cleaning up a full phone much quicker. Run it first when storage is nearly full.

Install it

pkg install ncdu

Run this inside Termux. If the package is already present, pkg will say so and do nothing.

Commands worth knowing

6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.

ncdu /sdcard Scan a directory tree and show the biggest items first. Step into any folder to see what fills it.
ncdu -x Stay on one filesystem and skip mounted volumes. External storage is not counted by accident.
ncdu -e Show apparent sizes rather than disk usage. More accurate when files are sparse or compressed.
ncdu --exclude "*.zip" Skip files matching a pattern. Archives you do not intend to remove stay out of the totals.
ncdu -o report.json /sdcard Save the scan to a file. Reopen or compare it later without walking the tree again.
ncdu -f report.json Open a previously saved scan for browsing instead of scanning the disk again.

Worked example

Run ncdu /sdcard and this is what you should see.

termux
$ ncdu /sdcard
    4.2 GiB [##########] /Download
    1.8 GiB [####      ] /DCIM
  812.0 MiB [##        ] /Android

Developed by

Yorhel (Yoran Heling) · released under MIT.