brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: ncdu shows what fills your disk and lets you delete from the same screen

Disk
~/tips/ncdu

ncdu -x /

Shows disk usage as a navigable list, biggest first, with delete built in.

du gives me numbers, but I still have to type my way into every folder. ncdu does the same job as a screen I can walk through with the arrow keys.

ncdu -x /

It scans first and then shows folders sorted by size, biggest on top. Use the arrow keys to go in and out, press d to delete the selected item after a confirmation, and q to quit. -x keeps the scan on one filesystem, so mounted disks and network shares do not get counted.

Caveat: scanning a large disk takes time and causes a lot of reads. Start it with -r for read-only mode when you only want to look, because that turns the delete key off.

Further reading: ncdu manual

More Disk tips sudo e2freefrag /dev/sdb1 sudo smartctl -a --json /dev/sda | jq '.smart_status.passed' lsscsi -s udisksctl power-off -b /dev/sdX du -sh — .[!.]* * 2>/dev/null | sort -h All Disk tips (44) All topics

Link