MCPcopy
hub / github.com/muesli/duf

github.com/muesli/duf @v0.9.1 sqlite

repository ↗ · DeepWiki ↗ · release v0.9.1 ↗
89 symbols 190 edges 19 files 39 documented · 44%
README

duf

Latest Release Go Doc Software License Build Status Go ReportCard

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

duf

Features

  • [x] User-friendly, colorful output
  • [x] Adjusts to your terminal's theme & width
  • [x] Sort the results according to your needs
  • [x] Groups & filters devices
  • [x] 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!

Core symbols most depended-on inside this repo

inColumns
called by 27
table.go
byteToString
called by 9
mounts.go
Stat
called by 6
mounts_linux.go
deviceType
called by 6
filesystems.go
parseCommaSeparatedValues
called by 6
main.go
sizeToString
called by 5
table.go
columnIDs
called by 4
table.go
getMount
called by 3
mounts_windows.go

Shape

Function 79
Struct 6
Method 4

Languages

Go100%

Modules by API surface

mounts_windows.go18 symbols
table.go17 symbols
main.go8 symbols
mounts.go5 symbols
filesystems_windows.go5 symbols
mounts_linux.go4 symbols
filesystems_openbsd.go4 symbols
filesystems_linux.go4 symbols
filesystems_freebsd.go4 symbols
filesystems_darwin.go4 symbols
themes.go3 symbols
mounts_openbsd.go2 symbols

Dependencies from manifests, versioned

github.com/IGLOU-EU/go-wildcardv1.0.3 · 1×
github.com/aymanbagabas/go-osc52/v2v2.0.1 · 1×
github.com/jedib0t/go-pretty/v6v6.6.8 · 1×
github.com/lucasb-eyer/go-colorfulv1.2.0 · 1×
github.com/mattn/go-isattyv0.0.20 · 1×
github.com/mattn/go-runewidthv0.0.16 · 1×
github.com/muesli/mangov0.2.0 · 1×
github.com/muesli/roffv0.1.0 · 1×
github.com/muesli/termenvv0.16.0 · 1×
github.com/rivo/unisegv0.4.7 · 1×
golang.org/x/sysv0.35.0 · 1×
golang.org/x/termv0.34.0 · 1×

For agents

$ claude mcp add duf \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact