Modern Replacements for du
Compare dust, dua, erdtree and pdu as replacements for du: output format, filtering, JSON output, gitignore handling and interactive deletion.
Updated
short verdict
Pick dust if you want du with automatic recursion, percentage bars and a config file. Pick dua when you also want an interactive mode to delete files, pdu when you need JSON in and out for pipes, and erdtree when you want .gitignore-aware sizes or a flat du-like layout. None documents du flag compatibility, so existing scripts that parse du output need checking.
du prints one line per directory and leaves sorting, depth limits and finding the biggest entries to you. The tools below scan in parallel and show sizes as a ranked tree or chart. They differ in how they present results (bars, tree layouts, JSON), in what they count by default, and in whether they can also delete files. Interactive treemap and file-cleaner TUIs are listed separately at the end because they do not produce du-style output.
this page is for
- Developers who run du -h | sort -h and want the largest entries shown directly
- Admins who want disk usage results as JSON for other CLI tools
- Anyone who wants to scan a directory and then delete files from the same tool
Recurses automatically and draws percentage bars for the largest entries, with filters and a persistent config file.
best for
- Interactive du replacement at the prompt
- Finding the largest subdirectories without sorting
strengths
- Shows a terminal-height number of entries by default, with bars for relative size at each level
- -s switches between apparent size and disk usage; -j outputs JSON
- Filters: -D/-F for directories or files, -e/-v for regex include/exclude, -z for a minimum size
- Settings persist in ~/.config/dust/config.toml
weaknesses
- Output is a bar chart tree, not du's one-line-per-path format
- No interactive mode for deleting files
Scans in parallel in a plain CLI mode and also offers an interactive TUI that can delete files.
best for
- Scanning and then cleaning up in one tool
- Users on Windows, macOS and Linux
strengths
- Parallel traversal by default, using jwalk
- Interactive mode with multi-stage deletion protection against accidental removal
- Runs on Unix-like systems, macOS and Windows
- Optional config in OS-specific config directories, including Esc key behavior
weaknesses
- Interactive mode is where deletion lives, so it is not a drop-in for non-interactive du calls
- No documented JSON output or du-compatible flags
Combines du, tree and find-style features, skips gitignored files by default, and has a flat du-like layout.
best for
- Sizing source trees without node_modules-style clutter
- Users who want tree, long view and size in one command
strengths
- Respects .gitignore and hidden file rules by default
- Layouts: regular tree, inverted tree and flat du-like output
- Sizes in logical or physical bytes, blocks, word count or line count
- Regex and glob search, LS_COLORS colors, TOML config, shell completions for bash, fish and zsh
weaknesses
- Ignoring gitignored and hidden files by default means totals can differ from du
- Much broader scope than du, so more options to learn
- Thread count defaults to up to 10 and is configurable
Parallel analyzer that draws charts and reads and writes JSON, so it fits into Unix pipelines.
best for
- Piping disk usage data into other tools
- Hardlink-heavy directories
strengths
- --json-output and --json-input allow pipe-based integration
- Hardlink detection with optional deduplication
- Progress reporting and adjustable depth and chart size
- Benchmarks are published against dust, dua, ncdu and gdu
weaknesses
- Ignores reflinks on copy-on-write filesystems
- Does not follow symbolic links
- Install documented for Pacman and Cargo only
What changes compared to du
These differences come from each project's documented behavior.
- dust recurses on its own and shows a terminal-height list of entries with percentage bars, instead of one line per directory
- dust -s toggles apparent size versus disk usage; erdtree can count logical or physical bytes, blocks, words or lines
- erdtree skips gitignored and hidden files by default, so its totals may not match du on a repository
- pdu reads and writes JSON with --json-input and --json-output; dust has -j for JSON output
- dua scans in parallel by default and adds an interactive mode where you can delete files; pdu counts hardlinks as real unless you deduplicate
When not to use these
- Scripts that parse du output or rely on du flags, since no project documents du-compatible flags or output
- Minimal servers where installing a Cargo or Homebrew package is not allowed and du is already present
Also worth a look
FAQ
- Can dust, dua, erdtree or pdu replace du in scripts?
- Drop-in compatibility with du flags or output is not documented for any of them. For scripting, pdu (--json-output) and dust (-j) produce JSON, which is easier to parse than bar charts.
- Which du replacement shows the biggest directories first?
- dust recurses through the tree and shows the largest entries with percentage bars by default, without a separate sort step.
- Do any of them respect .gitignore?
- erdtree does, along with hidden file rules, by default. The other tools' documentation does not mention it.
- Which replacement can delete files after scanning?
- dua's interactive mode can, with multi-stage deletion protection. diskonaut and cull also delete from a TUI, but they are interactive analyzers rather than du-style tools.