duf: A Modern and User-Friendly Disk Usage/Free Utility

Summary
duf is a modern, user-friendly command-line utility that serves as an enhanced alternative to the traditional 'df' command. It provides colorful, adaptable output, adjusting to your terminal's theme and width, and includes features like sorting, grouping, and filtering. Available across Linux, BSD, macOS, and Windows, duf simplifies disk space monitoring with its intuitive interface and convenient JSON output.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
duf is a modern and user-friendly command-line utility designed to replace the traditional df
command. Written in Go, it offers a visually appealing and highly functional way to inspect disk usage and free space across various operating systems, including Linux, BSD, macOS, and Windows. Key features include colorful, adaptable output that adjusts to your terminal, flexible sorting and filtering options, and the ability to output data in JSON format for scripting.
Installation
Installing duf is straightforward, with pre-built binaries and package manager support available for most major operating systems. For detailed instructions, please refer to the official GitHub repository's README. Below are some common installation methods:
pacman -S duf # Arch Linux
apt install duf # Ubuntu (22.04+) / Debian (12+)
brew install duf # macOS with Homebrew
choco install duf # Windows with Chocolatey
You can also install from source if you have a working Go environment (Go 1.23 or higher is required):
git clone https://github.com/muesli/duf.git
cd duf
go build
Examples
duf is designed for ease of use. Here are some examples to get you started:
Basic Usage:
duf
List specific devices or mount points:
duf /home /some/file
List everything, including pseudo and inaccessible file systems:
duf --all
Filter to show only local and network filesystems:
duf --only local,network
Sort the output by usage:
duf --sort usage
Output results as JSON:
duf --json
Why use duf?
While the traditional df
command is a staple for system administrators, duf offers several compelling reasons to switch:
- Enhanced Readability: Its colorful and user-friendly output makes it much easier to quickly grasp disk space information compared to
df
. - Adaptable Interface: duf automatically adjusts to your terminal's theme and width, providing an optimal viewing experience.
- Powerful Filtering and Sorting: Easily filter by device type, filesystem, or mount point, and sort results by various criteria like size, usage, or inodes.
- Cross-Platform Support: Works seamlessly across Linux, BSD, macOS, and Windows, providing a consistent experience.
- JSON Output: For scripting and automation, the
--json
flag provides structured data that's easy to parse.
Links
Explore duf further through these official links:
- GitHub Repository: https://github.com/muesli/duf
- GoDoc Reference: https://pkg.go.dev/github.com/muesli/duf
- Latest Releases: https://github.com/muesli/duf/releases