explaingit

muesli/duf

Analysis updated 2026-06-24

15,041GoAudience · ops devopsComplexity · 2/5Setup · easy

TLDR

duf is a Go command-line replacement for df that shows disk usage as a coloured table, with filters, sortable columns, JSON output, and cross-platform builds.

Mindmap

mindmap
  root((duf))
    Inputs
      Mount paths
      Filter flags
    Outputs
      Coloured table
      JSON output
    Use Cases
      Replace df
      Check disk usage
      Script disk reports
    Tech Stack
      Go
      Terminal
      Cross platform
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Check free space across all mounted drives with a coloured terminal table

USE CASE 2

Filter the view to local disks only or to a specific filesystem type

USE CASE 3

Emit disk usage as JSON for a shell script or monitoring agent

USE CASE 4

Find directories full of small files by switching to inode mode

What is it built with?

GoCLI

How does it compare?

muesli/dufcayleygraph/cayleyv2raya/v2raya
Stars15,04115,04315,034
LanguageGoGoGo
Setup difficultyeasymoderatemoderate
Complexity2/54/53/5
Audienceops devopsdeveloperops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Ready-made packages exist for most OSes, oh-my-zsh users must unalias duf first because the shell config defines a conflicting alias.

In plain English

duf is a command-line tool that shows how much space is used and how much is free on each disk and mounted drive attached to your computer. It is presented as a friendlier replacement for the older Unix tool df. Where df prints a dense table of numbers and cryptic device names, duf draws a coloured table that fits the width of the terminal, groups similar devices together, and uses red, green, or yellow to show at a glance which volumes are getting full. The project is written in Go and runs on Linux, the BSDs, macOS, and Windows. The README points to ready-made packages in most of the common package managers: pacman on Arch, apt on Ubuntu and Debian, dnf on Fedora, Nix, Homebrew and MacPorts on macOS, Chocolatey and scoop on Windows, pkg on FreeBSD, and even pkg inside Termux on Android. Pre-built binaries are also published on the releases page, and the source can be compiled with go build after cloning the repo, as long as Go 1.23 or newer is installed. Run with no arguments, duf lists every mount it can see. Arguments narrow the view. You can pass paths to focus on specific mount points, use --all to include the pseudo and duplicate file systems that are usually hidden, or use --only and --hide to keep or remove whole groups such as local, network, fuse, special, loops, and binds. There are matching --only-fs, --hide-fs, --only-mp, and --hide-mp flags to filter by filesystem type or mount path, and quoted wildcards like /sys/* are accepted. The display itself is configurable. The --sort flag orders the table by any column (size, used, available, usage percent, inode counts, type, filesystem, or mount point), and --output picks which columns appear. A --inodes mode swaps block usage for inode usage, useful when a disk is full of small files. The colour cut-offs that decide when a volume turns yellow or red can be tuned with --avail-threshold and --usage-threshold. A --theme flag helps when the terminal background is misdetected. For scripting, duf can print the same information as JSON with the --json flag. One troubleshooting note in the README: users of oh-my-zsh need to run unalias duf first, because that shell config already defines a duf alias.

Copy-paste prompts

Prompt 1
Install duf on macOS with Homebrew and run it with the --only local flag
Prompt 2
Write a shell script that uses duf --json to alert when any local volume crosses 90 percent usage
Prompt 3
Sort the duf table by usage percent and hide pseudo file systems
Prompt 4
Show me how to fix the oh-my-zsh duf alias collision so the binary runs

Frequently asked questions

What is duf?

duf is a Go command-line replacement for df that shows disk usage as a coloured table, with filters, sortable columns, JSON output, and cross-platform builds.

What language is duf written in?

Mainly Go. The stack also includes Go, CLI.

How hard is duf to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is duf for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.