Disk Usage/Free Utility - a better 'df' alternative
  • Go 95.2%
  • Roff 4.8%
Find a file
dependabot[bot] 4636deb4a7 build(deps): bump github.com/mattn/go-runewidth from 0.0.17 to 0.0.19
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.17 to 0.0.19.
- [Commits](https://github.com/mattn/go-runewidth/compare/v0.0.17...v0.0.19)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-runewidth
  dependency-version: 0.0.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-30 13:29:37 +02:00
.github build(deps): bump actions/setup-go from 5.5.0 to 6.0.0 2025-09-05 09:09:55 +02:00
.gitignore Add dist/ to .gitignore 2020-09-21 07:41:22 +02:00
.golangci-soft.yml fix: update golangci-lint actions 2025-08-26 00:50:18 +02:00
.golangci.yml fix: update golangci-lint actions 2025-08-26 00:50:18 +02:00
.goreleaser.yml fix: include version number in tarballs 2025-09-08 22:19:45 +02:00
duf.1 docs: update man page 2025-09-30 10:35:43 +00:00
duf.png Update screenshot 2020-10-10 10:48:42 +02:00
filesystems.go Evaluate symlinks in paths passed in as user arguments 2020-11-02 08:47:41 +01:00
filesystems_darwin.go Add Go 1.17 build tags 2022-02-01 04:29:09 +01:00
filesystems_freebsd.go Add Go 1.17 build tags 2022-02-01 04:29:09 +01:00
filesystems_linux.go ci: deadcode linter is no longer used 2025-08-26 06:48:38 +02:00
filesystems_openbsd.go Add Go 1.17 build tags 2022-02-01 04:29:09 +01:00
filesystems_windows.go Add Go 1.17 build tags 2022-02-01 04:29:09 +01:00
go.mod build(deps): bump github.com/mattn/go-runewidth from 0.0.17 to 0.0.19 2025-09-30 13:29:37 +02:00
go.sum build(deps): bump github.com/mattn/go-runewidth from 0.0.17 to 0.0.19 2025-09-30 13:29:37 +02:00
groups.go Add godoc comments and fix linter warnings 2022-02-08 07:24:48 +01:00
LICENSE Add gopsutil's LICENSE 2021-03-26 04:27:15 +01:00
main.go feat: add noop -h flag for df compat (#325) 2025-09-10 03:35:15 +02:00
man.go fix: create man page from pflag 2025-09-10 03:50:44 +02:00
mounts.go ci: deadcode linter is no longer used 2025-08-26 06:48:38 +02:00
mounts_darwin.go Add Go 1.17 build tags 2022-02-01 04:29:09 +01:00
mounts_freebsd.go Add Go 1.17 build tags 2022-02-01 04:29:09 +01:00
mounts_linux.go fix: 9p path parse error with WSL2 (#300) 2025-09-07 11:22:02 +02:00
mounts_linux_test.go fix: 9p path parse error with WSL2 (#300) 2025-09-07 11:22:02 +02:00
mounts_openbsd.go chore: x/sys API change 2022-09-23 14:28:21 +02:00
mounts_windows.go Add Go 1.17 build tags 2022-02-01 04:29:09 +01:00
README.md chore: require Go 1.23+ 2025-08-27 05:02:18 +02:00
style.go gofmt style.go 2021-03-22 18:50:47 +01:00
table.go chore: align happy path to left edge in bar rendering 2025-09-07 10:49:24 +02:00
themes.go fix: move background colors to theme 2025-09-05 11:19:10 +02:00

duf

Latest Release Go Doc Software License Build Status Go ReportCard

Disk Usage/Free Utility (Linux, BSD, macOS & Windows)

duf

Features

  • User-friendly, colorful output
  • Adjusts to your terminal's theme & width
  • Sort the results according to your needs
  • Groups & filters devices
  • Can conveniently output JSON

Installation

Packages

Linux

  • Arch Linux: pacman -S duf
  • Ubuntu (22.04 and later) / Debian (12 and later): apt install duf
  • Fedora Linux: dnf install duf
  • Nix: nix-env -iA nixpkgs.duf
  • Void Linux: xbps-install -S duf
  • Gentoo Linux: emerge sys-fs/duf
  • Solus: eopkg it duf
  • Packages in Alpine, Debian & RPM formats

BSD

  • FreeBSD: pkg install duf
  • OpenBSD: pkg_add duf

macOS

  • with Homebrew: brew install duf
  • with MacPorts: sudo port selfupdate && sudo port install duf

Windows

Android

  • Android (via termux): pkg install duf

Binaries

  • Binaries for Linux, FreeBSD, OpenBSD, macOS, Windows

From source

Make sure you have a working Go environment (Go 1.23 or higher is required). See the install instructions.

Compiling duf is easy, simply run:

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

Usage

You can simply start duf without any command-line arguments:

duf

If you supply arguments, duf will only list specific devices & mount points:

duf /home /some/file

If you want to list everything (including pseudo, duplicate, inaccessible file systems):

duf --all

Filtering

You can show and hide specific tables:

duf --only local,network,fuse,special,loops,binds
duf --hide local,network,fuse,special,loops,binds

You can also show and hide specific filesystems:

duf --only-fs tmpfs,vfat
duf --hide-fs tmpfs,vfat

...or specific mount points:

duf --only-mp /,/home,/dev
duf --hide-mp /,/home,/dev

Wildcards inside quotes work:

duf --only-mp '/sys/*,/dev/*'

Display options

Sort the output:

duf --sort size

Valid keys are: mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem.

Show or hide specific columns:

duf --output mountpoint,size,usage

Valid keys are: mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem.

List inode information instead of block usage:

duf --inodes

If duf doesn't detect your terminal's colors correctly, you can set a theme:

duf --theme light

Color-coding & Thresholds

duf highlights the availability & usage columns in red, green, or yellow, depending on how much space is still available. You can set your own thresholds:

duf --avail-threshold="10G,1G"
duf --usage-threshold="0.5,0.9"

Bonus

If you prefer your output as JSON:

duf --json

Troubleshooting

Users of oh-my-zsh should be aware that it already defines an alias called duf, which you will have to remove in order to use duf:

unalias duf

Feedback

Got some feedback or suggestions? Please open an issue or drop me a note!