dua-cli is a free, open source system cleanup & optimization project written in Rust and released under MIT. It has 6,277 GitHub stars, 170 forks and 0 open issues, and was last pushed 6 days ago. On this registry it ranks #5 of 12 tracked projects in System Cleanup & Optimization, with 5 head-to-head comparisons available.

What is dua-cli?

dua-cli is a terminal-based, parallel disk usage analyzer written in Rust that reports how much space a directory consumes and optionally deletes unwanted data, built for developers, system administrators, and anyone cleaning up storage from a shell rather than a graphical desktop application.

What it is

dua-cli — short for Disk Usage Analyzer, and invoked as dua — is a command-line program distributed through crates.io, Homebrew, MacPorts, Scoop, WinGet, dnf, pacman, xbps, pkgin, Nix, and x-cmd. It walks a directory tree, accumulates the space each entry consumes, and presents the result as a text report, a sorted summary of child directories, or an interactive terminal interface. The README describes it as parallel by default, deliberately saturating SSD bandwidth so that answers arrive as fast as the hardware allows.

The concrete problem it solves is the two-step shell workflow of inspecting disk usage and then removing what you find, which normally means running one utility to measure and another to delete, with the results of the first held only in scrollback. dua-cli performs both jobs in one tool: dua counts the space used in the current working directory, dua * counts all directories that are not hidden, and the interactive mode combines exploration with deletion so the decision and the action share a screen. The README states that its deletion path is faster than rm, the utility it displaces for cleanup work.

Key capabilities

  • dua i launches interactive mode for exploring and deleting files without leaving the terminal.
  • Traversal runs parallel by default and is designed to max out SSD throughput.
  • Deletion is implemented for speed, and the README claims it outperforms rm.
  • dua aggregate provides an aggregate view, with dua aggregate --help documenting the available traversal options.
  • On macOS, --deduplicate-apfs-clones counts fully shared APFS file clones only once in aggregate and interactive runs; it is opt-in because gathering the extra metadata reduces traversal performance, and files sharing only some blocks are not deduplicated.
  • The terminal user interface is optional at build time: cargo install dua-cli --no-default-features produces a compatible build without it, while --no-default-features --features tui-crossplatform restores it for most platforms.
  • Release archives ship with build provenance attestations, verifiable through gh attestation verify ./dua-v2.39.1-aarch64-apple-darwin.tar.gz --repo Byron/dua-cli.

Who uses it and how

  • Developers on machines with large working trees, source checkouts, and package caches, who need to find the few directories responsible for a full SSD.
  • System administrators working on headless servers, where the no-TUI build installed with --no-default-features fits a minimal environment.
  • macOS users whose storage accounting is distorted by APFS clones, who enable --deduplicate-apfs-clones to get an accurate aggregate figure.
  • Users on Fedora, Arch Linux, VoidLinux, NetBSD, NixOS, and Windows who install through the native package manager rather than compiling from source.
  • Anyone doing periodic cleanup, who runs the interactive mode to review and delete candidates in a single pass instead of measuring first and deleting later.

Getting started

Install with cargo install dua-cli, or through a platform package manager such as brew install dua-cli, scoop install dua, or winget install Byron.dua-cli. Then run dua to measure the current directory, dua * to cover all non-hidden directories, or dua i to enter interactive mode.

How it compares

The facts provided name no paid products that dua-cli replaces. Within this registry it stands beside the classic shell utilities it overlaps with, most directly rm, whose cleanup role it takes over while adding measurement and an interactive review step that rm does not provide. No direct competitor is identified in the supplied material.

When to use it — and when not to

dua-cli is a single local binary with no server, database, or mail component to operate, so self-hosting amounts to installing the package. Two limitations are worth weighing: building from source on Windows currently requires cargo +nightly install dua-cli, and a build made with --no-default-features omits the terminal interface, so interactive exploration is unavailable in that configuration. Anyone who needs a graphical interface, a hosted dashboard, or cross-machine reporting should look elsewhere, since dua-cli is terminal-based and scoped to the local filesystem.

project readme (upstream, from github) — read inline

Rust Crates.io Packaging status

dua (-> Disk Usage Analyzer) is a tool to conveniently learn about the usage of disk space of a given directory. It's parallel by default and will max out your SSD, providing relevant information as fast as possible. Optionally delete superfluous data, and do so more quickly than rm.

Run dua i to launch the interactive mode for exploring and deleting files.

asciicast

Installation

Binary Release

MacOS
curl -LSfs https://raw.githubusercontent.com/Byron/dua-cli/master/ci/install.sh | \
    sh -s -- --git Byron/dua-cli --crate dua
MacOS via MacPorts:
sudo port selfupdate
sudo port install dua-cli
MacOS via Homebrew
brew update
brew install dua-cli
Linux

Linux requires the target to be specified explicitly to obtain the MUSL build.

curl -LSfs https://raw.githubusercontent.com/Byron/dua-cli/master/ci/install.sh | \
    sh -s -- --git Byron/dua-cli --target x86_64-unknown-linux-musl --crate dua
Windows via Scoop
scoop install dua
Windows via WinGet
winget install Byron.dua-cli
Pre-built Binaries

See the releases section for manual installation of a binary, pre-built for many platforms.

Release archives include build provenance attestations. After downloading an archive, verify that it was built by this repository with the GitHub CLI:

gh attestation verify ./dua-v2.39.1-aarch64-apple-darwin.tar.gz --repo Byron/dua-cli
Cargo

Via cargo, which can be obtained using [rustup][rustup]

For Unix

cargo install dua-cli

# And if you don't need a terminal user interface (most compatible)
cargo install dua-cli --no-default-features

# Compiles on most platforms, with terminal user interface
cargo install dua-cli --no-default-features --features tui-crossplatform

For Windows, nightly features are currently required.

cargo +nightly install dua-cli
VoidLinux

Via xbps on your VoidLinux system.

xbps-install dua-cli
Fedora

Via dnf on your Fedora system.

sudo dnf install dua-cli
Arch Linux

Via pacman on your ArchLinux system.

sudo pacman -S dua-cli
NixOS

https://search.nixos.org/packages?query=dua

Nix-shell (temporary)

nix-shell -p dua

NixOS configuration

  environment.systemPackages = [
    pkgs.dua
  ];
NetBSD

Via pkgin on your NetBSD system.

pkgin install dua-cli

Or, building from source

cd /usr/pkgsrc/sysutils/dua-cli
make install
Windows

You will find pre-built binaries for Windows in the releases section. Alternatively, install via cargo as in

cargo +nightly install dua-cli
x-cmd

x-cmd is a toolbox for Posix Shell, offering a lightweight package manager built using shell and awk.

x env use dua
  • Additionally, the x dua ... command is available, which automatically installs dua without affecting the environment, such as not modifying the PATH variable.

Usage

# count the space used in the current working directory
dua
# count the space used in all directories that are not hidden
dua *
# learn about additional functionality
dua aggregate --help

On macOS, the --deduplicate-apfs-clones traversal option counts fully shared APFS file clones only once in aggregate and interactive runs. It is opt-in because collecting the additional metadata reduces traversal performance. Files that share only some blocks are not deduplicated, and --apparent-size still reports each file's logical length.

Tree output

By default aggregate prints a flat listing. Pass --depth N to instead print an indented tree that descends N levels into each input, which is handy for sharing a disk-usage report without opening interactive mode. The inputs form the first level, so --depth 1 lists just them, the same set of entries the flat listing shows.

# show each top-level entry and one level below it
dua aggregate --depth 2

--no-sort and --no-total work the same way they do for the flat listing.

Excluding paths with a pattern file

--ignore-from FILE reads gitignore-style patterns and leaves everything they match out of the report, in both aggregate and interactive mode. This is the --exclude-from of rsync and the --exclude-file of restic, so the same file can answer "how much of this would actually get backed up?".

cat .duaignore
# /target/
# **/node_modules/
# *.log
# !important.log

dua --ignore-from .duaignore

Patterns follow .gitignore syntax - # comments, a trailing / to match directories only, a leading / to anchor to the current working directory or the traversal root, ** to span directories, and ! to re-include something an earlier pattern excluded. They match the paths dua reports, which are relative to the directory being looked at, and matching is case-sensitive on every platform.

The option can be given more than once, in which case later files win over earlier ones, and it can also be set through DUA_IGNORE_FROM. Excluded directories are not descended into at all, so their contents cannot be re-included - the same restriction Git has.

Interactive Mode

Launch into interactive mode with the i or interactive subcommand. Get help on keyboard shortcuts with ?. Use this mode to explore, and/or to delete files and directories to release disk space.

Press ] to minimize or restore the entire right side. Tab cycles through visible panes; ? restores and focuses Help when the right side is minimized.

Please note that great care has been taken to prevent accidental deletions due to a multi-stage process, which makes this mode viable for exploration.

dua i
dua interactive

The interactive interface can be localized via the standard POSIX locale environment variables, in the usual order of precedence LC_ALL > LC_MESSAGES > LANG. English is the default. The following translations are listed in the order they were added: German (de), Japanese (ja), Korean (ko), and Simplified Chinese (zh, zh_CN, zh_SG, or zh_Hans). They are available when the locale uses UTF-8 or omits the codeset:

Please open an issue to request support for your language, if you would be available for reviewing it as well.

LANG=de_DE.UTF-8 dua i   # German interface
LANG=ja_JP.UTF-8 dua i   # Japanese interface
LANG=ko_KR.UTF-8 dua i   # Korean interface
LANG=zh_CN.UTF-8 dua i   # Simplified Chinese interface

Cleanup Mode

dua clean [DIRECTORY]... finds disposable directories and lists them largest first as sizing finishes. With no paths, it searches the current directory. Nothing is deleted automatically.

dua clean ~/dev
dua clean --depth 3 ~/dev ~/Downloads

Candidates include node_modules, Python caches and virtual environments, Cargo project target directories, and Zig's .zig-cache, zig-cache, and zig-out. In Git repositories, candidates must be ignored and contain no tracked files. Directories containing a .git entry (regardless of case) and paths excluded by traversal options are skipped.

The hub groups sibling candidates and deeper candidates under their shared parent. Open a group to browse, sort, or search within it; go back to return to the hub. Use the usual marking and deletion keys. Marking a group selects only its candidates, leaving other contents untouched.

  • R in the hub repeats discovery; r rechecks the selected candidate or existing group members.
  • Inside a candidate, either refresh key rechecks the whole candidate. Refresh clears all marks.
  • Discovery is unlimited by default. --depth 0 checks only the supplied directories for great speedups; candidates are always sized completely.

Traversal options, --no-entry-check, and --once are supported. Parent scanning, snapshot import, and snapshot export are unavailable.

Flame graphs

dua stacks prints folded stacks—the "collapsed" interchange format read by flame-graph tools. Each line is an entry's path with ; between its components, a space, and its size in bytes:

dua stacks > disk-usage.folded

`dua flame

readme truncated — read the full docs on github

Frequently asked questions

Is dua-cli free to use?

dua-cli is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does dua-cli do?

View disk space usage and delete unwanted data, fast.

What is dua-cli written in?

dua-cli is primarily written in Rust. Its source is publicly available at https://github.com/Byron/dua-cli, and it has 6,277 GitHub stars.