duf Disk usage overview

Version 0.9.1 · source

Start here

duf
Show mounted disks
duf <path>
Only the disk holding it
duf --all
Include hidden filesystems
duf --sort size
Biggest first
duf --only local
Local disks only
duf --hide-fs tmpfs
Skip a fs type
duf --inodes
Inode usage instead
duf --json
Machine-readable output

Concepts

  1. Pick devices paths or none
  2. Filter group, fs, mount
  3. Order by any column
  4. Columns table or JSON

Basics

duf
Table of mounted filesystems
duf <path> ...
Only the devices or mount points given
A plain file path works too: it shows the filesystem containing it.
duf --all
Add pseudo, duplicate and inaccessible fs
duf --inodes
Show inode usage instead of blocks
duf --theme light
Fix colours on a light terminal
duf --help
List all flags

Filter

duf --only <group>[,<group>]
Show only these groups
Groups: local, network, fuse, special, loops, binds.
duf --hide <group>[,<group>]
Hide these groups
duf --only-fs <type>[,<type>]
Only these filesystem types
Example: --only-fs ext4,xfs
duf --hide-fs <type>[,<type>]
Hide these filesystem types
duf --only-mp <path>[,<path>]
Only these mount points
duf --hide-mp <path>[,<path>]
Hide these mount points
Wildcards work if quoted: --hide-mp '/sys/*,/dev/*'

Sort and columns

duf --sort <key>
Order rows by a column
duf --output <col>[,<col>]
Choose and order columns
duf --sort usage
Order by how full each disk is
duf --output mountpoint,size,avail
Compact space overview
duf --output mountpoint,inodes_usage
Spot inode exhaustion
Sort keys and columns
Group Names
Space mountpoint, size, used, avail, usage
Inodes inodes, inodes_used, inodes_avail, inodes_usage
Identity type, filesystem

Thresholds and output

duf --avail-threshold="<warn>,<crit>"
Colour by free space
Example: --avail-threshold="10G,1G"
duf --usage-threshold="<warn>,<crit>"
Colour by used fraction
Example: --usage-threshold="0.5,0.9"
duf --json
Print JSON instead of a table
duf --json | jq .
Pretty-print or filter the JSON

Recipes

Real disks only, fullest first
duf --only local --hide-fs tmpfs,devtmpfs --sort usage
Small overview of a few paths
duf / /home --output mountpoint,size,avail,usage
Dump to a file for a report
duf --json > disks.jsonduf --all --json | jq '.[0]'
Quiet the noise on a busy host
duf --hide-mp '/sys/*,/dev/*,/run/*' --hide special