commands
df — Report filesystem capacity
Report capacity for mounted filesystems; -i requests inode statistics, -h uses human-readable units. Values vary over time. Use a fresh private workspace; live operations are VM-only.
Formal Syntax & Structure
linux syntaxlinux
df [OPTIONS] [FILE ...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| --output | option | Select columns |
| -i | option | Inodes |
| -h | option | Human readable |
| FILE | operand | Path on filesystem |
Return Value
exit status and output
GNU df prints filesystem capacity (or inode counts with -i) and returns nonzero on reporting errors. A successful report may still show exhausted capacity; interpret the reported values.
Working Example
Example Snippetlinux
df --output=avail . | awk 'NR==2 {if ($1 ~ /^[0-9]+$/) print "available blocks reported"}'