Linux for Developers
/Beginner
df
Definition
Disk Free. A command used to display the amount of available and used disk space on file systems.
Explain Like I'm New
The 'How full is my hard drive?' command.
Real World Example
A database crashes. The admin types `df -h`. The output shows `/dev/sda1` is `100%` full. The database crashed because it ran out of hard drive space.
Common Use Cases
- •Disk space monitoring
- •Preventing outages
Crucial Command Flags
| Flag / Option | Description |
|---|---|
| -h | Human-readable (e.g., 1K 234M 2G). |
| -i | List inode information instead of block usage. |
| -T | Print file system type. |
Interview Questions
basic
- What does the highly popular `-h` flag do in the command `df -h`?
intermediate
- Does `df` tell you exactly which specific folder is taking up all the space?