Storage exhaustion is a frequent operational issue on developer workstations and production Linux servers alike. When a disk partition reaches full capacity, pinpointing which specific subdirectories or log directories are consuming gigabytes of storage using traditional tools like du -sh * can be painfully sluggish. Even popular ncurses utilities like ncdu struggle when auditing drives containing hundreds of thousands of files due to single-threaded directory walking.
gdu (Go Disk Usage) is a modern, parallelised terminal disk usage analyser created explicitly for speed. Written in Go, gdu harnesses multiple CPU cores simultaneously to traverse large SSDs and NVMe arrays in seconds, presenting a clean interactive terminal dashboard where you can browse hierarchies and purge bloated files safely. Here is how to install and master gdu on Linux.
Why Choose gdu Over Traditional Disk Analysers?
gdu provides significant performance and usability advantages over legacy command-line tools:
- Multi-Threaded Concurrency: Scans directory structures across multiple CPU threads simultaneously, completing audits up to three to five times faster than single-threaded tools on NVMe drives.
- Interactive Navigation: Move through folders using intuitive Vim-like directional keys (
j,k,h,l) or standard keyboard arrows. - Safe In-Place Deletion: Inspect file details and delete unwanted tarballs, cache folders, or orphaned containers directly from the interface with confirmation prompts.
- Cross-Filesystem Awareness: Displays drive mount points, filesystem types (ext4, btrfs, zfs), and avoids crossing into network shares unless explicitly commanded.
Installing gdu on Linux Distributions
gdu is readily available in package repositories and as static standalone binaries.
Method 1: Ubuntu and Debian
On modern Ubuntu (22.04 LTS and newer) and Debian:
sudo apt update
sudo apt install gdu -y
gdu --version
Method 2: Arch Linux and Fedora
On Arch Linux:
sudo pacman -S gdu
On Fedora Linux:
sudo dnf install gdu -y
Method 3: Universal Static Binary
To acquire the latest pre-compiled static release directly from GitHub:
curl -L https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz | tar xz
chmod +x gdu_linux_amd64
sudo mv gdu_linux_amd64 /usr/local/bin/gdu
Running Your First Interactive Audit
To analyse your current working directory, simply run:
gdu
To inspect your entire root filesystem with administrative privileges:
sudo gdu /
gdu scans the partition with high throughput and immediately displays a visual list of subfolders sorted by size, complete with bar charts indicating relative capacity percentages.
Interactive Keyboard Navigation
Mastering gdu’s hotkeys makes investigating disk bloat effortless:
| Keybinding | Action | Description |
|---|---|---|
Down / j, Up / k |
Navigate List | Move cursor up and down through files and directories |
Enter / Right / l |
Enter Directory | Step inside the highlighted subfolder |
Left / h |
Exit Directory | Step backward to the parent directory |
d |
Delete Selected | Prompts for confirmation to purge file or directory |
v |
View File | Opens file contents in the default terminal pager |
q |
Quit | Exits gdu cleanly to your shell prompt |
Auditing Disks in Read-Only Mode
If you are inspecting critical production servers and wish to guarantee that no files can be deleted accidentally by Junior operators, launch gdu in read-only mode:
gdu --read-only /var/log
In this mode, all deletion shortcuts are suppressed.
Ignoring Specific Mount Points or Directories
To prevent gdu from traversing virtual proc filesystems or external NFS shares:
gdu --ignore-dirs /proc,/sys,/dev /