Operations 7 min read

Mastering duf: Fast, Colorful Disk Usage Tool for Linux, macOS, Windows

This guide introduces duf, a Golang‑based command‑line utility that displays disk usage across Linux, macOS, BSD, Android and Windows, explains its key features, provides step‑by‑step installation methods for various distributions, and demonstrates common usage options and output formats.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Mastering duf: Fast, Colorful Disk Usage Tool for Linux, macOS, Windows

What is duf?

duf (Disk Usage/Free) is a lightweight, color‑enhanced command‑line tool written in Go that reports available and used disk space on Unix‑like systems, Windows, and Android. It presents information in a tidy table with optional JSON output.

Key Features

Easy to use

Colorful, adaptive display

Auto‑adjusts height and width to terminal size

Sortable and filterable data

Supports grouping and custom output

JSON output for scripting

Installation

Build from source (requires Go)

git clone https://github.com/muesli/duf.git
cd duf
go build

Debian / Ubuntu (.deb package)

wget https://github.com/muesli/duf/releases/download/v0.5.0/checksums.txt
wget https://github.com/muesli/duf/releases/download/v0.5.0/duf_0.5.0_linux_amd64.deb
sha256sum --ignore-missing -c checksums.txt
sudo dpkg -i duf_0.5.0_linux_amd64.deb

RPM based distros (CentOS, RHEL, Fedora, OpenSUSE)

wget https://github.com/muesli/duf/releases/download/v0.5.0/duf_0.5.0_linux_amd64.rpm
wget https://github.com/muesli/duf/releases/download/v0.5.0/checksums.txt
sha256sum --ignore-missing -c checksums.txt
rpm -ivh duf_0.5.0_linux_amd64.rpm

Arch Linux (AUR)

# sudo pacman -S --needed base-devel
git clone https://aur.archlinux.org/duf.git
cd duf
less PKGBUILD
makepkg -si

Android (Termux)

pkg install duf

macOS

Install via Homebrew: brew install duf Or via MacPorts:

sudo port selfupdate && sudo port install duf

FreeBSD

sudo sh -c 'pkg update && pkg upgrade && pkg install duf'

Windows (Scoop)

scoop install duf

Basic Usage

Run duf to list all mounted filesystems with size, used, available, usage percentage, type, and mount point.

Advanced Options

Show a specific mount point: duf /home or duf /home/linuxmi Display all filesystems, including pseudo and inaccessible ones: duf --all Sort output: duf --sort size|used|mountpoint|... (valid keys: mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem)

Custom columns: duf --output mountpoint,size,usage Show inode information instead of block usage: duf --inodes Switch theme: duf --theme dark or duf --theme light JSON output for scripting:

duf --json

Conclusion

duf is a compact, visually appealing CLI utility that works well on personal Linux desktops, macOS machines, and development servers. It is not recommended for production servers without further evaluation. For more details, consult the project’s GitHub repository.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxInstallationsystem-monitoringdisk usageduf
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.