Terminal GuideTerminal Guide
duf icon

duf

Modern CLI
macOSLinuxWindows
Go

Better df alternative with user-friendly output.

Official Website

Features

Color OutputJSON OutputSortingFiltering
Replaces
df

Installation

Homebrew
brew install duf
APT (Debian/Ubuntu)
apt install duf
Pacman (Arch)
pacman -S duf

Why use duf?

duf is a modern and visually superior disk usage display tool that completely replaces the traditional df command. With beautiful table formatting and progress bars, disk status is instantly clear.

Beautiful Table Output

Display in colorful, organized table format. Much more readable than traditional df command.

Progress Bar Display

Visualize usage percentage of each device with progress bars. Quickly see which disks are full.

Device Type Grouping

Automatically group and display local disks, network drives, FUSE mounts, etc.

JSON/CSV Output

Support JSON/CSV format output for easy use in scripts and pipelines. Ideal for automation.

Basic Usage

Display Disk Usage

Basic Commands
# Display all mount points
duf

# Display disk information for specific paths
duf /home /var

# Display all file systems (including hidden devices)
duf --all

Output Example

╭───────────────────────────────────────────────────────────────────────────────────╮
Local Disks
├───────────────────────────────────────────────────────────────────────────────────┤
FILESYSTEM SIZE USED AVAIL USE% MOUNTED ON
│ /dev/sda1 500G 350G 150G 70% ████████████████████░░░░░░░░ / │
│ /dev/sdb1 1.0T 200G 800G 20% ██████░░░░░░░░░░░░░░░░░░░░░░ /data │
│ /dev/nvme0n1p1 256G 180G 76G 70% ████████████████████░░░░░░░░ /home │
╰───────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────────────────────────────────╮
Network Volumes
├───────────────────────────────────────────────────────────────────────────────────┤
│ //nas/share 2.0T 1.5T 500G 75% ██████████████████████░░░░░░ /mnt/nas │
╰───────────────────────────────────────────────────────────────────────────────────╯

Grouped by device type (local, network, etc.), usage percentages are shown with progress bars and colors.

Common Options

OptionDescriptionExample
--allDisplay all file systemsduf --all
--onlyDisplay only specified typeduf --only local
--hideHide specified typeduf --hide special
--jsonOutput in JSON formatduf --json
--outputSpecify columns to displayduf --output mountpoint,size,used
--sortSpecify column to sort byduf --sort size
--themeSpecify themeduf --theme dark
--widthSpecify output widthduf --width 100
--inodesDisplay inode informationduf --inodes

Output Formats

JSON Output

Output in JSON format for easy processing in scripts and pipelines.

JSON Output
# Output in JSON format
duf --json

# Extract specific information with jq
duf --json | jq '.[] | select(.mount_point == "/") | .used'

# Extract disks with 80%+ usage
duf --json | jq '.[] | select(.use_percent > 80)'
[
  {
    "device": "/dev/sda1",
    "device_type": "local",
    "mount_point": "/",
    "fs_type": "ext4",
    "total": 536870912000,
    "free": 161061273600,
    "used": 375809638400,
    "inodes": 33554432,
    "inodes_free": 32000000,
    "inodes_used": 1554432,
    "use_percent": 70.0,
    "inodes_use_percent": 4.6
  }
]

CSV Output

CSV Output
# Output in CSV format (for spreadsheet or database import)
duf --json | jq -r '.[] | [.device, .mount_point, .total, .used, .use_percent] | @csv'

Practical Examples

Filter by Device Type

Filtering
# Display only local disks
duf --only local

# Display only network volumes
duf --only network

# Display only local and network
duf --only local,network

# Hide special file systems
duf --hide special

# Hide loopback devices
duf --hide loops

# Hide multiple types
duf --hide special,loops,fuse,binds

Available device types: local, network, fuse, special, loops, binds

Sorting

Sorting
# Sort by size
duf --sort size

# Sort by usage percentage
duf --sort usage

# Sort by available space
duf --sort avail

# Sort by file system name
duf --sort filesystem

# Sort by mount point
duf --sort mountpoint

# Reverse sort
duf --sort size --invert

Customize Display Columns

Column Specification
# Specify columns to display
duf --output mountpoint,size,used,avail,usage

# Available columns
# mountpoint   - Mount point
# size         - Total size
# used         - Used space
# avail        - Available space
# usage        - Usage percentage
# inodes       - Inode information
# inodes_used  - Used inodes
# inodes_avail - Available inodes
# inodes_usage - Inode usage percentage
# type         - File system type
# filesystem   - Device name

# Simple display
duf --output mountpoint,usage

# Detailed display
duf --output filesystem,mountpoint,type,size,used,avail,usage,inodes,inodes_usage

Display Specific Devices or Paths

Display Specific Paths
# Display disk information for specific paths
duf /home /var /tmp

# Display only root partition information
duf /

# Check multiple paths
duf /home /var/log /opt

Disk Usage Monitoring Script

Monitoring Script Example
#!/bin/bash
# Alert if disk usage exceeds 80%

threshold=80

duf --json | jq -r '.[] | select(.use_percent > '"$threshold"') |
  "WARNING: (.mount_point) is (.use_percent)% full"' | while read line; do
  echo "$line"
  # Add actions like email or Slack notifications
done

Configuration and Customization

Theme Configuration

duf supports multiple color themes.

Theme Configuration
# Dark theme
duf --theme dark

# Light theme
duf --theme light

# Check available themes
duf --help

Configuration File

Persist settings in ~/.config/duf/config.json.

~/.config/duf/config.json
{
  "hide": ["special", "loops"],
  "only": [],
  "output": ["mountpoint", "size", "used", "avail", "usage"],
  "sort": "usage",
  "width": 0,
  "theme": "dark",
  "inodes": false
}

Shell Alias Configuration

Alias Configuration
# ~/.bashrc or ~/.zshrc

# Replace df with duf
alias df='duf'

# Display only local disks
alias dfl='duf --only local'

# Sort by usage
alias dfs='duf --sort usage'

# Simple display
alias dff='duf --output mountpoint,size,usage'

# JSON output
alias dfj='duf --json'

# Detailed display
alias dfa='duf --all --output filesystem,mountpoint,type,size,used,avail,usage'

Comparison with df

Featuredfduf
Color Output-Colorful table display
Progress Bar-Visualize usage percentage
Device Grouping-Auto group by type
JSON Output-Native support
Filtering-t, -x optionsIntuitive with --only, --hide
SortingManual piping requiredEasy with --sort
Human-Readable Format-h option requiredDefault
Config File-JSON config support
Cross-PlatformPOSIX onlyLinux, macOS, Windows

Tips and Tricks

  • duf is written in Go and runs as a single binary with no dependencies
  • Use --hide special,loops to hide systemd and Docker temporary file systems for better readability
  • Combine JSON output with jq to easily create disk usage monitoring scripts
  • Colors and progress bars are automatically disabled when piping or redirecting, so it's safe to use in scripts
  • Colors change based on usage (green→yellow→red). Displays warning color above 80%
  • Display automatically adjusts to terminal width. You can also specify fixed width with --width
  • Create a config file to avoid having to specify options every time
Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More