duf — Disk Usage/Free Utility Made Beautiful
duf replaces the classic `df` command with a colorful, human-readable table showing disk usage across all your mounts. Better ergonomics, clearer layout, and zero learning curve.
What it is
duf is a modern replacement for the classic Unix df command. It displays disk usage and free space in a colorful, well-formatted table that is easier to read than df's raw output. It automatically groups local devices, network mounts, and special filesystems into separate sections.
The tool targets system administrators, DevOps engineers, and any developer who checks disk space regularly. It runs on Linux, macOS, and Windows with no dependencies.
How it saves time or tokens
Reading df output requires mentally parsing aligned columns with raw byte counts. duf presents the same data in a formatted table with color-coded usage bars, human-readable sizes (GB/TB), and clear grouping by filesystem type. You get the answer at a glance instead of squinting at numbers.
How to use
- Install duf via your package manager.
- Run
dufin the terminal. - Optionally filter by mount point or filesystem type.
# Install
brew install duf # macOS
sudo apt install duf # Debian/Ubuntu
scoop install duf # Windows
# Basic usage
duf
# Show only local devices
duf --only local
# Show specific path
duf /home
# JSON output for scripting
duf --json
Example
$ duf --only local
+-------+--------+--------+--------+------+----------+
| Mount | Size | Used | Avail | Use% | Type |
+-------+--------+--------+--------+------+----------+
| / | 256 GB | 142 GB | 114 GB | 55% | ext4 |
| /boot | 1 GB | 312 MB | 712 MB | 30% | ext4 |
| /home | 512 GB | 287 GB | 225 GB | 56% | ext4 |
+-------+--------+--------+--------+------+----------+
(Actual output includes color bars and better formatting)
Related on TokRepo
- Featured workflows — Discover popular CLI tool configurations
- DevOps tools — System monitoring and infrastructure tools
Common pitfalls
- On systems with many network mounts (NFS, CIFS), duf can hang while querying unresponsive mounts. Use --only local to skip network filesystems.
- The JSON output format (--json) differs from df's output format, so existing scripts parsing df output need adjustment if migrating.
- Some minimal container images do not include the /proc/mounts information duf needs. Running duf inside a container may show incomplete results.
Frequently Asked Questions
Yes. duf runs on Linux, macOS, FreeBSD, and Windows. It is a single binary with no external dependencies. Installation is available through most package managers including Homebrew, apt, pacman, scoop, and choco.
Yes. duf provides a --json flag that outputs structured JSON data suitable for parsing in scripts. You can also use --output to select specific columns and --sort to control the sort order for scripted processing.
duf replaces df (shows filesystem-level usage per mount point). ncdu and dust replace du (shows file and directory-level usage within a path). They serve different purposes. Use duf to check overall disk space; use ncdu or dust to find which files consume space.
duf uses colors based on your terminal's color scheme. It supports 256-color and truecolor terminals. If colors are not rendering correctly, check that your terminal emulator supports the expected color mode. You can also use --no-color to disable colors.
Yes. duf is actively maintained on GitHub with regular releases. It is written in Go, which ensures easy cross-compilation and minimal runtime dependencies. The project accepts community contributions and bug reports.
Citations (3)
- duf GitHub— duf is a better df alternative with colorful output
- duf README— duf supports JSON output for scripting and multiple OS platforms
- Linux man pages— The df command displays filesystem disk space usage
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.