Operations 5 min read

Master Disk Space Insight with duf: Install, Use, and Customize

This guide explains how to install the duf command‑line tool on Ubuntu, macOS, and Windows, and demonstrates its usage with options like --only local, --sort used, --json, and --inodes to provide a visual, adaptive view of disk and inode usage.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Disk Space Insight with duf: Install, Use, and Customize

The traditional du (disk usage) and df (disk free) commands show how much space files or filesystems occupy, but they operate separately. duf is a Go‑written, cross‑platform utility that combines both functions, presenting results in a colour‑coded, adaptive table that can be sorted and filtered.

1. Installing duf

On Ubuntu, download the Debian package from the official GitHub releases and install it with dpkg:

$ wget https://github.com/muesli/duf/releases/download/v0.8.1/duf_0.8.1_linux_amd64.deb
$ dpkg -i duf_0.8.1_linux_amd64.deb

On macOS you can install via Homebrew or MacPorts:

$ brew install duf
# or
$ sudo port selfupdate && sudo port install duf

On Windows the tool is available through Chocolatey or Scoop:

$ choco install duf
# or
$ scoop install duf

2. Using duf

Running duf without arguments prints a colour‑coded table that lists all local disks, mounted cloud storage devices, and special mounts such as temporary locations.

$ duf

Common options let you filter and sort the output: --only local – display only local devices. --sort used – sort entries by used space. --sort size – sort entries by total size. --all – include all filesystems, even hidden ones. --json – output the result in JSON format. --inodes – show inode usage instead of block usage.

You can also query a specific path or mount point:

$ duf /home

3. Summary

The duf command merges the capabilities of du and df into a single, adaptive, colour‑rich table, making disk‑usage inspection faster, more visual, and easier to interpret than the original utilities.

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.

command-linesystem-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.