System administration

Linux df command

Show available and used disk space for mounted filesystems.

Availability: Common Linux commands; shell built-ins and external implementations may differ by distribution.中文

Syntax

df [OPTION]... [FILE]...

Examples

Show mounted filesystems, types and readable capacity.

df -hT

Check inode usage for the filesystem containing /var.

df -i /var

Parameters, options and clauses

Option / clauseDescription
-h, --human-readableShow sizes in powers of 1024 with readable units.
-H, --siShow sizes in powers of 1000.
-T, --print-typeInclude filesystem type.
-i, --inodesShow inode usage instead of block usage.
-P, --portabilityUse the POSIX output format.
--totalDisplay a grand total where applicable.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory