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.
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.debOn macOS you can install via Homebrew or MacPorts:
$ brew install duf
# or
$ sudo port selfupdate && sudo port install dufOn Windows the tool is available through Chocolatey or Scoop:
$ choco install duf
# or
$ scoop install duf2. 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.
$ dufCommon 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 /home3. 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.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
