Skip to content

dua Setup: Interactive Disk Usage in the Terminal

First PublishedByAtif Alam

dua (Disk Usage Analyzer, Homebrew package dua-cli) is a Rust disk usage tool with an interactive terminal UI.

It highlights rolled-up directory sizes so you see what actually consumes space.

The Homebrew formula ships the dua command:

Terminal window
brew install dua-cli

Check:

Terminal window
dua --version

dua i opens the TUI (same as dua interactive):

Terminal window
dua i ~
dua i /Volumes/YourDrive

Navigate with arrow keys, drill into directories with Enter, quit with q. Replace /Volumes/YourDrive with your mount path.

KeyAction
/ Move selection
EnterOpen directory
dMark selection for deletion
uUndo mark
qQuit
?In-app help

Bindings can change between releases; ? inside dua i is authoritative.

Deletion marks are destructive once you confirm — prefer dry runs on copies or backups until you trust the workflow.

Without the interactive subcommand, dua aggregates paths you pass (same underlying idea as dua aggregate, alias dua a):

Terminal window
dua /Volumes/YourDrive
dua aggregate /Volumes/YourDrive
dua ~

Use dua aggregate --help for byte format (metric, binary, MiB/GiB, and similar), threads, and --stay-on-filesystem (-x) when you must not cross mounts.

Spotlight, revisions, and event logs can confuse scanners or flood errors. Skip them with repeated --ignore-dirs:

Terminal window
dua i /Volumes/YourDrive \
--ignore-dirs /Volumes/YourDrive/.DocumentRevisions-V100 \
--ignore-dirs /Volumes/YourDrive/.Spotlight-V100 \
--ignore-dirs /Volumes/YourDrive/.fseventsd

Adjust names if your volume uses variants (for example .DocumentRevisions without -V100).

Terminal window
# dua — disk usage TUI
alias dh='dua i ~'
alias dv='dua i /Volumes'

Reload source ~/.zshrc. Use dv only when multiple volumes are mounted and you intend to pick one inside the UI.

ToolRole
du / du -shAlways available; great one-off summaries, no TUI
ncduClassic ncurses disk explorer (brew install ncdu)
duaRust TUI; interactive dua i plus script-friendly dua <path>

Pick one primary TUI per habit; dua and ncdu overlap for exploration.

macOS privacy (TCC) can block reads even when Unix permissions look fine. Grant Full Disk Access to your terminal app and retry — walkthrough in Fix TCC / Full Disk Access on External Disk Permissions and Disk Usage.

Errors Under .Spotlight-V100 or .DocumentRevisions

Section titled “Errors Under .Spotlight-V100 or .DocumentRevisions”

Use --ignore-dirs as above; those directories are system-managed and rarely belong in manual cleanup via dua.

Use eza (listings with color) tree modes; use dua when the question is how much space each subtree uses.