# dua

> Disk usage analyzer that provides fast, parallel directory scanning with an optional interactive TUI for file deletion

Stars: 6.4k · Categories: File Management

- Repository: https://github.com/Byron/dua-cli
- Website: https://lib.rs/crates/dua-cli
- Page: https://www.trmn.sh/tools/dua

## Install

- Homebrew: `brew install dua-cli`
- Cargo: `cargo install dua-cli`
- Arch Linux: `sudo pacman -S dua-cli`

## Overview

dua (Disk Usage Analyzer) is a command-line tool that analyzes disk space usage within directories. It performs parallel directory traversal by default to maximize SSD performance and provide results quickly. The tool can operate in two modes: a standard command-line mode that displays disk usage statistics, and an interactive terminal user interface (TUI) mode that allows users to explore directory structures and delete files directly.

The interactive mode includes multi-stage deletion protection to prevent accidental file removal, making it suitable for both exploration and cleanup tasks. Users can navigate through directories, view space usage statistics, and selectively delete files or directories. The tool supports keyboard shortcuts accessible via the help system in interactive mode.

dua reads optional configuration from OS-specific config directories and supports customization of keyboard behavior, such as whether the Esc key navigates to parent directories or quits the application. The tool is built with crossterm as its terminal backend and uses jwalk for efficient directory traversal. It supports most Unix-like systems, macOS, and Windows, with some platform-specific installation options and feature variations.

### Installation

```bash
# via Homebrew
brew install dua-cli
```

```bash
# via Cargo
cargo install dua-cli
```

```bash
# via Arch Linux
sudo pacman -S dua-cli
```

![dua interactive mode demonstration](https://asciinema.org/a/kDnXUOeqBxZVMoWuFNqzfpeey.svg)

## Alternatives

- [xplr](https://www.trmn.sh/tools/xplr.md): Terminal-based file explorer with Lua scripting, keyboard controls, and plugin system for command-line integration (Rust, 4.8k stars)
- [pdfcpu](https://www.trmn.sh/tools/pdfcpu.md): PDF processing library and CLI written in Go for validating, merging, splitting, encrypting, stamping, signing and extracting content from PDFs. (Go, 8.9k stars)
- [ouch](https://www.trmn.sh/tools/ouch.md): CLI tool for compressing and decompressing files across 14+ formats with automatic format detection (Rust, 3.8k stars)
- [doxx](https://www.trmn.sh/tools/doxx.md): Terminal-native .docx document viewer with formatting, search, and export capabilities (3.8k stars)
- [npkill](https://www.trmn.sh/tools/npkill.md): Interactive TUI that scans for node_modules directories, shows their size and last modification, and lets you delete selected ones to free disk space. (TypeScript, 9.5k stars)

## Guides

- [Modern Replacements for du](https://www.trmn.sh/replace/du): Compare dust, dua, erdtree and pdu as replacements for du: output format, filtering, JSON output, gitignore handling and interactive deletion.
- [Best Disk Usage Analyzers](https://www.trmn.sh/best/disk-usage-analyzers): Compare dust, dua, and diskonaut plus pdu, cull and erdtree for finding what fills your disk from the terminal.

---

Canonical: https://www.trmn.sh/tools/dua
