df - report filesystem disk space usage
df [-h] [-i] [-T] [path]
Options you will use
-h, --human-readable- Sizes in powers of 1024.
-i, --inodes- Report inode usage instead of blocks. Check this when df says there is space but writes fail.
-T- Print the filesystem type.
-x, --exclude-type TYPE- Leave out file systems of this type: -x tmpfs -x overlay.
Gotchas
- Three reasons writes fail while df -h shows free space: (1) inodes exhausted - df -i; (2) a deleted file still held open - lsof +L1; (3) the 5% root-reserved blocks - tune2fs -l.
Taught in
Try df in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.