$linuxjunkies
>

duf(1)

duf is a disk usage analyzer that shows how much space directories and files consume in an easy-to-read format.

UbuntuDebianFedoraArch

Synopsis

duf [OPTION]... [FILE]...

Description

duf is a modern alternative to du and df that displays disk usage in a user-friendly way with colored output and progress bars. It recursively analyzes directories to show which folders consume the most space, making it easy to identify storage hogs on your system.

By default, duf shows the top-level directories in the current location sorted by size. It supports both local filesystems and remote paths, and can aggregate usage across multiple locations.

Common options

FlagWhat it does
-a, --allinclude hidden files and directories in the analysis
-r, --recursiverecursively show disk usage for subdirectories
-h, --hide-progresshide the progress bar during scanning
-c, --colorenable colored output (auto, on, off)
-o, --outputspecify output format (list, table, json)
-i, --ignore-all-in-fileread ignore patterns from a file (like .gitignore)
-H, --siuse SI units (powers of 1000) instead of IEC units (powers of 1024)
-d, --max-depth Nlimit analysis depth to N levels

Examples

show disk usage of top-level directories in the current directory

duf

analyze disk usage in the /home directory

duf /home

recursively show all subdirectories and their sizes under /home/user

duf -r /home/user

include hidden files and directories when analyzing /tmp

duf -a /tmp

output disk usage data in JSON format for /var to a file

duf -o json /var > usage.json

show disk usage up to 2 levels deep starting from root directory

duf --max-depth 2 /

display sizes using SI units (MB, GB) instead of binary units (MiB, GiB)

duf -H /home

analyze current directory while excluding patterns listed in .gitignore

duf --ignore-all-in-file .gitignore .

Related commands