Disk & StorageCLI Reference
$df
Report file system disk space usage across mounted storage partitions.
Syntax DefinitionPOSIX standard
df [OPTIONS] [FILE...]Try `df` Live in Interactive Sandbox
Zero-install client simulation with real-time feedback.
bash — terminal
AST Sandbox (Free)
Overview & How df Works
`df` (Disk Free) analyzes mounted filesystems to display total disk capacity, used space, available free space, and mount points. It is the first command sysadmins run when encountering "No space left on device" errors.
Common Flags & Command Options
| Flag / Option | Description |
|---|---|
| -h, --human-readable | Print sizes in human-readable powers of 1024 (e.g., 10G, 500M). |
| -T, --print-type | Include filesystem type column (ext4, xfs, btrfs, tmpfs). |
| -i, --inodes | Display inode usage statistics instead of block usage. |
Practical Real-World Examples
Example #1Check human-readable disk space
df -hDisplays disk usage for all mounted partitions with readable GB/MB units.
Sample Output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 14G 34G 30% /
tmpfs 3.9G 0 3.9G 0% /dev/shmFrequently Asked Questions
What does 100% inode usage mean in df -i?
If inodes are 100% full, the disk cannot create new files even if `df -h` reports gigabytes of free disk space remaining.