With the increasing volume of data and widespread use of storage devices in both business and personal environments, it is crucial to have tools that allow efficient management and analysis of disk space. Gdu (Go Disk Usage), an open-source utility written in the Go programming language, emerges as a powerful and straightforward solution for users needing precise information about their disks, whether on Windows, macOS, or Linux systems.
What Makes Gdu Unique
Unlike other disk usage analyzers like ncdu or dua, Gdu is optimized for SSDs, utilizing parallel processing to scan directories significantly faster. However, it can also work with HDDs, albeit with slightly lower performance.
Key Features of Gdu:
- Speed: Designed to maximize efficiency on SSDs.
- TUI Interface: Provides an intuitive terminal-based interface to navigate directories and visualize disk usage.
- Cross-Platform Compatibility: Available for Windows, macOS, and Linux.
- Advanced Options: Supports directory exclusion, apparent size display, and exporting results in JSON format.
- Easy Installation: Can be installed via package managers like snap and brew or directly from GitHub.
How to Install Gdu
Gdu offers flexible installation options to suit user preferences. Here are some popular methods:
- From the official repository on Linux:
sudo add-apt-repository ppa:daniel-milde/gdu sudo apt update sudo apt install gdu
- As a Snap package:
snap install gdu-disk-usage-analyzer snap connect gdu-disk-usage-analyzer:mount-observe :mount-observe snap connect gdu-disk-usage-analyzer:system-backup :system-backup sudo snap alias gdu-disk-usage-analyzer.gdu gdu
- From GitHub (latest version):
curl -L https://github.com/dundee/gdu/releases/latest/download/gdu_linux_amd64.tgz | tar xz sudo mv gdu_linux_amd64 /usr/bin/gdu
- For Windows and macOS: Available through Chocolatey, Homebrew, or precompiled packages on GitHub.
Practical Use of Gdu
Once installed, Gdu allows users to explore disk usage interactively or generate non-interactive outputs depending on their needs:
- To scan the current directory:
gdu
- To analyze a specific directory:
gdu /path/to/directory
- To export results in JSON format:
gdu -o result.json /path/to/directory
Additionally, Gdu allows the exclusion of specific items, such as hidden files, directories, or symbolic links, using options like -H
, -i
, or -L
.
Benefits for Advanced Users and System Administrators
Gdu’s integration capabilities with maintenance scripts or automated audits make it an excellent choice for system administrators. The non-interactive mode (-n
) and JSON export functionality make Gdu ideal for environments where disk usage analysis needs to be processed by other applications.
Comparative Alternatives
Although similar tools like ncdu, dua, and dust exist, Gdu stands out for its speed and its ability to leverage the performance advantages of SSDs. However, for HDD users, the performance differences may not be as significant.
Conclusion
Gdu is an essential tool for those looking for a fast, reliable, and cross-platform solution for disk space analysis. Whether for everyday tasks or managing large systems, Gdu provides detailed information and a seamless experience through the terminal. Available for free and supported by an active GitHub community, Gdu is a reliable choice for both advanced users and system administrators.