ClearDisk
Buy for $10Download ClearDiskDownload
A LITTLE MORE CLARITY

How to install and use ncdu on Mac

ncdu runs on macOS. To use ncdu on a Mac, install it with brew install ncdu and run ncdu -r -x ~ in Terminal to scan your home folder in read-only mode. It sorts every directory by actual disk usage so you can drill down with the arrow keys without risking a permanent d-key deletion.

1. Install ncdu with Homebrew

ncdu, short for NCurses Disk Usage, is a disk usage browser that runs in Terminal. It scans a folder once, then lets you move through the results sorted by size, which is quicker than running du again for every subfolder. Homebrew packages it for Apple silicon and Intel Macs.

Run brew install ncdu, then ncdu --version to confirm it is on your path. Homebrew installs the current release, and the options in this guide follow its current manual; older versions on other systems can differ slightly. If you decide you do not need it, brew uninstall ncdu removes it again.

brew install ncdu
ncdu --version

2. Scan your home folder in read-only mode

Start with ncdu -r -x ~. The -r flag disables ncdu’s delete feature, and giving it twice, as -r -r, also disables its shell key, so nothing in the session can change the disk. The -x flag keeps the scan on one filesystem, so it does not wander into external drives or network volumes.

Scan your home folder rather than the whole disk. macOS splits system and user data across volumes joined by firmlinks, which ncdu’s manual lists as unsupported, and your own files are in your home folder anyway. As with du, folders macOS protects show errors unless Terminal has Full Disk Access in System Settings → Privacy & Security.

ncdu -r -x ~

3. Read the screen

Results open sorted by size, largest first. Use the arrow keys to move, Return or the right arrow to open a folder, and the left arrow to go back up. The keys below change the view without changing any files.

By default ncdu shows disk usage, the space actually allocated. Apparent size is the file’s nominal length, which can differ a lot for sparse files such as virtual machine disks. Files copied as APFS clones share storage, but each copy is counted in full, so a total can be larger than what deleting would free. A letter before an entry flags something special; H, for example, marks a hard link whose data was already counted elsewhere.

  • s sorts by size and n by name; press again to reverse.
  • a switches between disk usage and apparent size.
  • g cycles between percentage, graph, both or neither.
  • e shows or hides hidden and excluded items; c shows item counts.
  • i shows details for the selected item, including its path.
  • r rescans the current folder; q quits.

4. Treat d as a permanent delete

Outside read-only mode, d deletes the selected file or folder. ncdu asks for confirmation by default, then removes the item directly: it does not go to the Trash, and there is no undo. The b key opens a shell in the current folder, where any command runs with your permissions. Both are reasons to start with -r whenever you only want to look.

Use ncdu to decide, and delete elsewhere. Copy the path from the i view, open it in Finder with Go → Go to Folder, and move it to the Trash, or use the tool’s own cleanup command for caches such as npm, Gradle or Homebrew. That keeps a way back if you pick the wrong folder.

ncdu, du and saved scans

The Terminal disk space guide uses du for one-off, sorted lists, which is enough to answer “which folder is biggest?”. ncdu is better when you want to explore, or rescan with r after a cleanup to see the difference. To keep a scan, export it with -o and open it later with -f; ncdu disables deletion when browsing an imported file. That also makes it easy to compare a folder before and after a cleanup without waiting for a second full scan.

--exclude-caches skips folders marked with a CACHEDIR.TAG file, such as Gradle’s caches, to show what remains without them. If you prefer a graphical view, ClearDisk’s free scan draws the same information as a storage map.

ncdu -x -o ~/home-scan.json ~
ncdu -f ~/home-scan.json

Common questions

Does ncdu work on macOS?

Yes. ncdu is a Terminal program and Homebrew packages it for the Mac, so brew install ncdu is all it needs. We checked on December 1, 2026: Homebrew on macOS 27 offered ncdu 2.9.2 as a prebuilt package for Apple silicon.

How do I use ncdu without risking deleting files by accident?

Run it as ncdu -r -x ~. The -r flag disables its delete feature, and doubling it as -r -r also disables the shell key, so nothing in that session can change your disk while you browse.

Does ncdu's delete key send files to the Trash?

No. Outside read-only mode, the d key deletes the selected file or folder directly after a confirmation prompt. There is no Trash step involved, and no undo.

Why should I scan my home folder instead of the whole disk with ncdu?

macOS splits system and user data across volumes joined by firmlinks, which ncdu's manual lists as unsupported. Your own files are in your home folder anyway, so scanning it directly avoids the issue entirely.

Can I save an ncdu scan to compare later?

Yes. Export it with the -o flag and reopen it later with -f. ncdu disables deletion when browsing an imported file, making it a safe way to compare a folder before and after a cleanup.

References & further reading

These guides combine the linked official guidance with ClearDisk’s documented behavior. Your files and app settings determine the right next step.

Main guide: how to check storage on Mac · Related pillar: how to find large files on Mac · Browse all Check storage guides →

FROM A NUMBER TO AN ANSWER

See what’s using
your space.

Explore your Mac with ClearDisk’s free local scanner.
Review the files. Keep the control.

Download free scannermacOS 15+ · version 2.2.1Cleanup license: $10 once