df Command Reference: Flags, Usage & CI Examples
df reports free and used space on mounted filesystems.
df shows filesystem capacity and usage per mount point. In CI it is the go-to for diagnosing "No space left on device" failures on runners with limited disk.
Common flags and usage
- -h: human-readable sizes
- -i: inode usage instead of bytes
- -T: show the filesystem type
- --output=source,size,used,avail,pcent: choose columns
- df -h <path>: just the filesystem holding a path
Example
shell
df -h /
df -i / # check inode exhaustion, not just bytesIn CI
Run df -h before a large build or artifact download to confirm there is room, and again after a failure to confirm whether disk caused it. "No space left on device" can also be inode exhaustion (millions of small files), which only df -i reveals.
Key takeaways
- df -h shows free space per filesystem.
- "No space left" can be inode exhaustion, visible only with df -i.
- Check df before and after disk-heavy steps in CI.
Related guides
du Command Reference: Flags, Usage & CI ExamplesReference for du: -h, -s, -d, -x, --exclude, sorting biggest directories, and a CI example that finds what is…
free Command Reference: Flags, Usage & CI ExamplesReference for free: -h, -m, -s, the available-vs-free distinction, and a CI example that checks memory headro…
top Command Reference: Flags, Batch Mode & CI ExamplesReference for top: -b batch mode, -n, -o, -d, the non-interactive logging pattern, and a CI example that capt…