LinuxCommandLibrary

duf

Display disk usage information

TLDR

List accessible devices

$ duf
copy

List everything (such as pseudo, duplicate or inaccessible file systems)
$ duf --all
copy

Only show specified devices or mount points
$ duf [path/to/directory1 path/to/directory2 ...]
copy

Sort the output by a specified criteria
$ duf --sort [size|used|avail|usage]
copy

Show or hide specific filesystems
$ duf --[only-fs|hide-fs] [tmpfs|vfat|ext4|xfs]
copy

Sort the output by key
$ duf --sort [mountpoint|size|used|avail|usage|inodes|inodes_used|inodes_avail|inodes_usage|type|filesystem]
copy

Change the theme (if duf fails to use the right theme)
$ duf --theme [dark|light]
copy

SYNOPSIS

duf [options] [path...]

PARAMETERS

-all
    Show all devices including pseudo, duplicate, and inaccessible file systems.

-inodes
    Show inode information instead of block usage.

-only
    Show only file systems of specified types (comma-separated).

-except
    Exclude file systems of specified types (comma-separated).

-mount-points
    Show only file systems mounted on the specified mount points (comma-separated).

-output
    Customize the output columns (comma-separated list of 'mountpoint', 'size', 'used', 'avail', 'usage', 'inodes', 'iused', 'iavail', 'iusage', 'type', 'fstype').

-json
    Output results in JSON format.

-theme
    Define a theme for the output (dark, light, ansi). Defaults to terminal settings.

-width
    Minimum width of table columns in terminal output.

-sort
    Sort output based on the specified column ('mountpoint', 'size', 'used', 'avail', 'usage', 'inodes', 'iused', 'iavail', 'iusage', 'type', 'fstype').

-reverse
    Reverse the sorting order.

-version
    Show the version number and exit.

-help
    Show help message and exit.

DESCRIPTION

duf is a modern, user-friendly alternative to the classic `df` command for displaying disk space usage on Linux and other Unix-like systems.

Unlike `df`, duf presents information in a more visually appealing and easier-to-understand format, using color-coded tables and gauges to highlight disk usage. It provides detailed information about mount points, total space, used space, available space, and inode usage. duf automatically adjusts column widths based on terminal size.

It supports filtering file systems based on type and mount point. duf can display disk usage information in various formats, including binary prefixes (KiB, MiB, GiB) or SI prefixes (kB, MB, GB). It's designed to be lightweight and efficient. duf supports multiple output styles including JSON output for scripting purposes.

CAVEATS

The accuracy of the disk space information depends on the underlying file system and the kernel's reporting mechanisms. Some file systems might have delayed or inaccurate reporting of space usage.

INSTALLATION

duf is typically available via package managers on most Linux distributions. For example, on Debian/Ubuntu, you can install it using `apt install duf`. Alternatively, you can download pre-built binaries from the project's GitHub releases page.

It's often recommended to use the package manager installation where possible to ensure proper integration and updates.

EXAMPLES

Show disk usage of all file systems except tmpfs: duf -except tmpfs
Show disk usage in JSON format: duf -json
Show only the mountpoint and size columns: duf -output mountpoint,size

HISTORY

duf is a relatively modern utility, designed to improve upon the usability and visual presentation of traditional disk space utilities like `df`. It has gained popularity for its ease of use and clear display of disk space information.

SEE ALSO

df(1), du(1), mount(8)

Copied to clipboard