gdu——command-line tool for scanning disk file usage

ncdu is a disk usage scanning tool, similar to DaisyDisk

ncdu /Users/ww/Downloads
# Just enter the path you want to scan after ncdu, / means scanning the entire disk

image

However, ncdu is only available on Mac and Linux platforms and does not have a Windows version.

After some searching, I found gdu has similar functionality and supports Linux, Mac, and Windows platforms.

The experience is almost the same as ncdu. After installation,

gdu /

# To avoid a conflict with `coreutils`, `gdu` has been installed as `gdu-go`.
# On macOS, you need to use gdu-go
gdu-go / 

gdu launched!

Windows Installation

Windows is recommended to install via the scoop package manager

scoop install main/gdu

You can also directly download and install the precompiled version from GitHub

Linux and macOS Installation

Use the appropriate package manager to install, for example,

brew install gdu

On Linux systems, ncdu (NCurses Disk Usage) is the classic disk space analysis tool, while gdu (Go Disk Usage) is a powerful recent challenger.

Both use terminal-based interactive interfaces, but differ in performance, underlying technology, and functional emphasis.


1. Core Comparison

Feature ncdu gdu
Underlying Language C Go
Scanning Speed Fast (single-threaded) Extremely fast (leverages multi-core concurrent scanning)
Interactivity Classic NCurses interface ncdu-like interface with color highlighting
Concurrent Processing No Yes (especially advantageous on SSDs)
Deletion Capability Supported Supported
Binary Size Extremely small Slightly larger (statically compiled)
Key Strengths Highly stable; available in nearly all official repositories Blazing speed; modern visual presentation

2. Detailed Comparative Analysis

Performance (Core Difference)

  • The core advantage of gdu lies in its concurrent scanning. On modern machines equipped with solid-state drives (SSDs), gdu can simultaneously utilize multiple CPU cores to traverse directory trees. For massive data volumes containing millions of files, gdu’s scan speed is typically several times faster than ncdu’s.
  • ncdu operates in single-threaded mode. While concurrency yields limited gains on traditional hard disk drives (HDDs), ncdu’s efficiency clearly lags behind gdu on SSDs.

Compatibility and Deployment

  • ncdu, a long-established tool, is pre-packaged in the official repositories of virtually all mainstream Linux distributions. It is often the preferred choice in minimal server environments or on embedded devices.
  • gdu, distributed as a single statically-linked binary, is also extremely simple to deploy. It is better suited for developers or system administrators seeking a modern, high-performance upgrade to ncdu on personal workstations or high-end servers.

Visuals and Interaction

  • ncdu features an elegantly minimalist interface—classic 1990s terminal aesthetics.
  • gdu, enabled by default with color support, uses distinct colors to differentiate directories from files and clearly displays space-usage percentages—visually more aligned with modern expectations.

3. Common Command Comparison

The operational logic of both tools is highly similar, enabling near-seamless switching.

  • Basic scan:
    • ncdu /path/to/dir
    • gdu /path/to/dir
  • Scan only current filesystem (do not cross mount points):
    • ncdu -x /
    • gdu -x /
  • Common interactive shortcuts:
    • Up/Down or j/k: Move cursor
    • Enter: Enter selected directory
    • d: Delete selected file or directory
    • q: Quit

4. Summary and Recommendations

  • Choose ncdu when:

    • You are maintaining a very legacy server.
    • You demand near-absolute software stability.
    • You prefer a minimalist, color-free interface.
  • Choose gdu when:

    • You need to scan directories containing massive numbers of small files (e.g., node_modules, machine learning datasets).
    • You are using SSD or NVMe storage.
    • You prefer a modern, color-highlighted, and more responsive tool.

One-sentence recommendation: If you prioritize maximum scanning efficiency, switch directly to gdu; if you only occasionally inspect disk usage on a server, ncdu remains more than sufficient.