Introduction
du -sh * works until you hit a 2TB monorepo and your terminal freezes. dua (Disk Usage Analyzer) scans in parallel across all cores and gives you an interactive TUI to navigate the tree, mark directories, and delete them in one keystroke — replacing the du | sort -h | head + rm -rf dance.
What dua Does
- Scans directories in parallel using all CPU cores.
- Reports apparent size, hard-link-aware real size, or raw block count.
- Provides interactive TUI with keybindings for navigation and deletion.
- Supports glob filters and exclude patterns.
- Outputs JSON / machine-readable formats.
Architecture Overview
dua uses walkdir + rayon to fan out the filesystem walk across worker threads. Each worker pushes file metadata into a lock-free channel; the aggregator builds a tree indexed by inode to deduplicate hard links. The TUI is built on crossterm + tui-rs, recomputing visible rows as you traverse.
Self-Hosting & Configuration
- Install via brew, cargo, apt, dnf, scoop.
DUA_CPUS=8tunes worker count (defaults to CPU count).--ignore-dirsskips known caches (node_modules, .git).--stay-on-filesystemavoids crossing mount points.- Exclude globs via
--ignore-patterns.
Key Features
- Interactive TUI with in-place deletion — rare for a du tool.
- Parallel scan scales with NVMe throughput.
- Hard-link-aware size calculation.
- Multi-root scanning in one invocation.
- Three size modes: apparent, real, blocks.
Comparison with Similar Tools
- du — POSIX classic; single-threaded, no UI.
- ncdu — interactive TUI in C; single-threaded.
- gdu — similar TUI in Go; comparable speed, different keymap.
- dust — colored bar chart for
du; non-interactive. - diskus — parallel
du -sh; no TUI.
FAQ
Q: Safe to delete inside the TUI?
A: Confirmation required; trash integration with --trash.
Q: Does it follow symlinks?
A: No by default (--follow-links enables).
Q: Network filesystems? A: Works, but throughput bound by NFS/SMB.
Q: Hard-link accounting? A: On — only counts inode once.