Skip to main content

df Cheatsheet

By Dejan Panovski Updated on Download PDF

Quick reference for the df command: check disk space, display formats, filesystem filtering, inodes, and custom output fields

df reports the amount of disk space used and available on filesystems. This cheatsheet covers display formats, filesystem filtering, inode usage, and custom output fields.

Basic Usage

Common ways to check disk space.

CommandDescription
dfShow disk usage for all mounted filesystems
df /pathShow filesystem usage for the given path
df -hHuman-readable sizes (K, M, G — powers of 1024)
df -HHuman-readable sizes (K, M, G — powers of 1000)
df -aInclude all filesystems (including pseudo and duplicate)
df --totalAdd a grand total row at the bottom

Size Formats

Control how sizes are displayed.

OptionDescription
-hAuto-scale using powers of 1024 (K, M, G)
-HAuto-scale using powers of 1000 (SI units)
-kDisplay sizes in 1K blocks (default on most systems)
-mDisplay sizes in 1M blocks
-BGDisplay sizes in 1G blocks
-B SIZEUse SIZE-byte blocks (e.g., -BM, -BG, -B512)

Output Columns

What each column in the default output means.

ColumnDescription
FilesystemDevice or remote path of the filesystem
1K-blocks / SizeTotal size of the filesystem
UsedSpace currently in use
AvailableSpace available for use
Use%Percentage of space used
Mounted onDirectory where the filesystem is mounted

Filesystem Type

Show or filter by filesystem type.

OptionDescription
-TShow filesystem type column
-t TYPEOnly show filesystems of the given type
-x TYPEExclude filesystems of the given type
-lShow only local filesystems (exclude network mounts)

Examples:

CommandDescription
df -t ext4Show only ext4 filesystems
df -x tmpfsExclude tmpfs from output
df -ThShow type column with human-readable sizes

Inode Usage

Show inode counts instead of block usage.

CommandDescription
df -iShow inode usage for all filesystems
df -ihShow inode usage with human-readable counts
df -i /pathShow inode usage for a specific filesystem
ColumnDescription
InodesTotal number of inodes
IUsedInodes in use
IFreeInodes available
IUse%Percentage of inodes used

Custom Output Fields

Select specific fields with --output.

FieldDescription
sourceFilesystem device
fstypeFilesystem type
sizeTotal size
usedSpace used
availSpace available
pcentPercentage used
iusedInodes used
iavailInodes available
ipcentInode percentage used
targetMount point

Example: df --output=source,size,used,avail,pcent,target -h

Use these references for deeper disk usage workflows.

GuideDescription
How to Check Disk Space in Linux Using the df CommandFull df guide with practical examples
Du Command in LinuxCheck disk usage for directories and files