df
Files and directories
Usage
df -hReports used and free space per filesystem; a disk can run out of inodes while bytes remain, and only df -i shows that.
Common flags
| Flag | Meaning |
|---|---|
| -h | Readable sizes instead of blocks |
| -i | Show inode use instead of bytes |
| -k | Report in 1K blocks, the portable form |
| -T | GNU: print the filesystem type. On BSD and macOS -T selects a type |
| -x | GNU: leave out a filesystem type, as in -x tmpfs |
Examples
df -hFree space on every mounted filesystem.
df -iWhen space remains but writes still fail, look here.
df -h .Space on the filesystem holding this directory.
Moving, deleting and finding. Some of these do not ask twice, which is why -i becomes a habit.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does df do?
Reports used and free space per filesystem; a disk can run out of inodes while bytes remain, and only df -i shows that.
Q. How do I type it?
df -h — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
5 are listed here; the full set is in man df. This command sits under Files and directories.
Related commands
man page: man df