The free disk tools that come with a terminal, compared
du, ncdu, dust and duf each answer a different question. Which to use when, with the exact commands and their macOS quirks.
Before installing anything with a window, it is worth knowing that the terminal on your Mac already answers most of these questions, and that three small tools make it pleasant rather than merely possible.
du, which is already installed
du -xh -d 1 ~ 2>/dev/null | sort -h | tail -20The flags matter on macOS. -x stays on one volume so it does not wander into mounted drives, -d 1 limits the depth so the output is readable, -h gives human sizes, and the redirect hides permission errors for folders macOS protects. Sorting with sort -h puts the largest last, which is what you want in a terminal because it is closest to the cursor.
ncdu, for exploring rather than reading
brew install ncdu
ncdu -x ~ncdu scans once and then lets you move around the result with arrow keys, entering folders and going back without rescanning. That is its whole advantage over du, and it is a large one: the usual disk hunt is five rounds of du, and ncdu makes it one scan and some arrow keys. It can delete with the d key, which is worth being careful with, since it removes rather than moving to the Trash.
dust, for a picture in text
brew install dust
dust -d 2 ~dust prints a tree with bars showing proportion, which is closer to what a graphical tool gives you. It is the fastest way to see the shape of a folder rather than its numbers, and it needs no interaction at all.
duf, for whole volumes
brew install duf
dufdf -h already lists volumes and free space; duf is the readable version. On a Mac the useful line is the data volume rather than the boot one, which is why the numbers look strange if you have not seen an APFS container laid out before.
Which to use when
| Question | Tool |
|---|---|
| What is the biggest thing in this folder | du with sort |
| Let me look around and drill in | ncdu |
| Show me the shape quickly | dust |
| How full are my volumes | duf, or df |
| Which app does this folder belong to | None of them |
What no terminal tool will tell you
That last row is the honest limit. These tools measure bytes per path, which is exactly what they claim to do. Whether a 6 GB folder is a cache that rebuilds itself, an app's only copy of your data, or a leftover from software you removed in 2023 is not a question about bytes, and it is the question that decides whether deleting it is safe.
That is the difference between measuring and cleaning up, and it is why what uninstalling leaves behind and what is safe in your Library folder exist as separate guides.
Common questions
What is the best command to check disk usage on a Mac?
du -xh -d 1 ~ piped through sort -h is the one to remember. It lists your home folder one level deep with human readable sizes, largest last, and staying on one volume so it does not scan mounted drives.
Is ncdu available on macOS?
Yes, through Homebrew with brew install ncdu. It scans once and lets you navigate the result interactively, which replaces repeated du commands. Be careful with its delete key, since it removes files rather than moving them to the Trash.
What is the difference between du and df?
du measures what a folder contains by walking it. df reports what a volume says is used and free. They disagree on a Mac because of snapshots and purgeable space, and neither is wrong.
Do terminal tools show hidden folders?
Yes, du and its relatives include hidden folders by default, which is why they often find things Finder never shows. They still cannot read folders macOS protects unless the terminal has full disk access.