# gdu

> Disk usage analyzer written in Go with an interactive terminal UI, non-interactive output, JSON export, database storage, and a web UI.

Stars: 6.2k · Language: Go · License: MIT · Categories: System

- Repository: https://github.com/dundee/gdu
- Page: https://www.trmn.sh/tools/gdu

## Install

- Homebrew (binary: gdu-go): `brew install -f gdu`
- Go: `go install github.com/dundee/gdu/v5/cmd/gdu@latest`
- Conda: `conda install gdu`

## Overview

gdu is a disk usage analyzer written in Go. It scans directories in parallel and presents sizes in an interactive console interface, where you can navigate with arrow keys or vim-style keys (j/k/h/l), sort by name or size, and show item counts. It supports parallel scanning as well as a `--sequential` mode for rotating disks.

From the interactive view you can delete the selected file or directory (`d`), move it to trash (`D`, with an optional `--trash-command` to use your own trash tool), or empty a directory (`e`). `--no-delete`, `--no-view-file` and `--no-spawn-shell` disable write operations, file viewing and shell spawning. Several directories can be passed at once and appear under a virtual `(multiple)` top level. `gdu -d` lists all mounted disks.

For scripting, `-n` prints stats without starting the TUI. `-s` shows only a total, `-t N` shows the top N largest files, and `--depth` limits the printed tree. Filtering options include ignoring paths by name (`-i`), regex pattern (`-I`), pattern file (`-X`) or .gitignore-style file (`-G`). You can also filter by file type (`-T`/`-E`) and by mtime (`--max-age`, `--min-age`, `--since`, `--until`), and `-x` avoids crossing filesystem boundaries.

Analysis results can be exported as JSON (`-o`) and re-imported later (`-f`). They can also be stored in SQLite or BadgerDB (`--db`) and reloaded with `-r`. `--web` serves a browser interface instead of the terminal UI, and `--archive-browsing` allows browsing zip/jar/tar archives. gdu is useful for developers and sysadmins who need to find what is using space on a machine.

### Installation

```bash
# via Homebrew (binary: gdu-go)
brew install -f gdu
```

```bash
# via Go
go install github.com/dundee/gdu/v5/cmd/gdu@latest
```

```bash
# via Conda
conda install gdu
```

## Alternatives

- [viddy](https://www.trmn.sh/tools/viddy.md): Enhanced watch command replacement with time machine mode, diff highlighting, and vim-like navigation (Go, 5.5k stars)
- [stern](https://www.trmn.sh/tools/stern.md): Kubernetes log tailing tool that aggregates logs from multiple pods and containers with regex filtering and color coding (Go, 4.9k stars)
- [tufw](https://www.trmn.sh/tools/tufw.md): Terminal user interface for managing ufw firewall rules with add, edit, and remove functionality (Go, 879 stars)
- [kure](https://www.trmn.sh/tools/kure.md): Command-line password manager with AES-GCM encryption and offline operation (Go, 172 stars)
- [ssm](https://www.trmn.sh/tools/ssm.md): Terminal UI for managing and connecting to SSH hosts with vim-style navigation and tagging (Go, 116 stars)

---

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