When server hard drives fill up or developer laptops run low on storage space, identifying which nested directories and abandoned virtual machine images consume gigabytes of disk capacity is an urgent priority. While classic utilities like du and ncdu are standard on Linux, running du -sh * or waiting for single-threaded ncdu sweeps across hundreds of thousands of files on modern multi-terabyte NVMe solid-state drives (SSDs) can cause frustrating delays. gdu (Go Disk Usage) is an open-source, terminal-based disk usage analyser designed specifically for maximum speed.
Written in Go, gdu utilizes parallel multi-core processing to traverse file trees significantly faster than traditional tools while presenting an interactive, keyboard-navigable terminal user interface (TUI). It allows system administrators and developers to drill down through directories, inspect individual file sizes, delete obsolete archives with a single keystroke, and export visual storage maps directly in the console. In this guide, you will learn how to install gdu on Linux, navigate storage trees with intuitive keyboard shortcuts, scan mounted network drives, and safely reclaim disk capacity.
Why Use gdu Over Traditional Linux Disk Analysers?
gdu provides major performance advantages on modern Linux systems:
- Parallelised Multithreaded Scanning: Scans multiple directories simultaneously across multiple CPU cores, achieving up to 3x faster speeds on SSDs and RAID arrays compared to ncdu.
- Interactive Terminal Interface: Browse folders seamlessly using Vim-style navigation keys (
h,j,k,l) or standard arrow keys. - Direct File Deletion: Delete unwanted directories or monolithic log files directly from the TUI with built-in safety confirmation prompts.
- Visual Usage Bars: Clear graphic progress indicators display the percentage of parent folder capacity consumed by each child directory.
- Read-Only Safety Mode: Launch with read-only flags to prevent accidental file deletion during production server audits.
Installing gdu on Linux
gdu is packaged across major Linux distribution repositories and available as standalone static binaries:
Method 1: Installing via Pre-Compiled GitHub Binary
For universal installation across any Linux distribution without external dependencies:
- Download the latest release archive using
curl:curl -L https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz | tar xz - Set executable permissions on the extracted binary:
chmod +x gdu_linux_amd64 - Move the executable to your system path:
sudo mv gdu_linux_amd64 /usr/local/bin/gdu - Verify installation:
gdu --version
Method 2: Installing via Native Package Managers
Install gdu using your distribution’s package manager:
- Ubuntu / Debian:
sudo add-apt-repository ppa:daniel-milde/gdu sudo apt update && sudo apt install gdu - Arch Linux:
sudo pacman -S gdu - Fedora:
sudo dnf install gdu - Snap Package:
sudo snap install gdu-disk-usage-analyzer sudo snap connect gdu-disk-usage-analyzer:mount-observe sudo snap connect gdu-disk-usage-analyzer:system-backup
Scanning Directories with gdu
Using gdu is straightforward. Launching it without arguments scans the current working directory:
gdu
Scanning Specific Mount Points and Root Filesystems
To inspect the entire system or specific storage partitions:
- Scan Root Filesystem:
sudo gdu / - Scan User Home Directory:
gdu /home/username - Scan Only Current Filesystem (Ignore Mounted Disks):
sudo gdu -x / - Launch in Read-Only Mode (Prevent Deletions):
gdu -r /var/log
Interactive Keyboard Controls in gdu
Once gdu completes its rapid scan, navigate the file hierarchy using these keyboard shortcuts:
| Key Shortcut | Action / Navigation Command |
|---|---|
Up / Down or k / j |
Move cursor up and down through files and directories. |
Enter / Right or l |
Open and drill down into the highlighted directory. |
Left or h |
Move back up to the parent directory. |
d |
Delete the highlighted file or directory (prompts for confirmation). |
v |
View file contents in the default pager or text viewer. |
c |
Show file item counts instead of byte dimensions. |
s |
Cycle sorting by file size, item count, or alphabetical name. |
q / Ctrl + C |
Exit gdu. |
Interpreting Visual Storage Flags in gdu
gdu annotates directory rows with prefix characters that describe special attributes:
!(Error): Indicates an inaccessible directory where read permissions were denied during scanning..(Empty): Represents an empty folder containing zero bytes or child items.@(Symlink): Indicates a symbolic link pointing to a file or folder elsewhere on the filesystem.e(Apparent Size): Represents hard links or specialized sparse allocation mappings.
Best Practices for Server Storage Maintenance
To keep Linux environments lean and performant:
- Target Ephemeral Directories First: Run
sudo gdu /var/logandgdu ~/.cacheto safely eliminate bloated system logs, crash dumps, and package manager cache archives. - Run in Background for Huge Arrays: If scanning multi-terabyte network shares, export results to a file for instant subsequent viewing without rescanning:
gdu -o /tmp/storage-analysis.json /mnt/storage gdu -f /tmp/storage-analysis.json - Combine with Automated Triggers: Incorporate gdu scans into administrative maintenance runbooks before scheduled kernel updates to ensure boot partitions retain sufficient free space.