df
Overview
The df
(disk free) command reports file system disk space usage. It shows the amount of disk space used and available on all mounted file systems.
Syntax
df [options] [file...]
Common Options
Option | Description |
---|---|
-h |
Human readable sizes |
-i |
List inode information |
-T |
Print file system type |
-a |
Show all file systems |
-l |
Local file systems only |
-t type |
Include specific types |
-x type |
Exclude specific types |
-P |
POSIX output format |
--total |
Show total usage |
Key Use Cases
- Disk space monitoring
- Storage management
- Capacity planning
- System maintenance
- Troubleshooting
Examples with Explanations
Example 1: Basic Usage
df -h
Show human-readable disk usage
Example 2: Inode Usage
df -i
Display inode information
Example 3: Specific Type
df -t ext4
Show only ext4 filesystems
Understanding Output
Columns explained: - Filesystem: Device/partition - Size: Total size - Used: Used space - Avail: Available space - Use%: Usage percentage - Mounted on: Mount point
Common Usage Patterns
Check space usage:
df -h /
Monitor inodes:
df -i /var
Show file system types:
df -T
Performance Analysis
- Fast execution
- Minimal system impact
- Real-time information
- Network fs impact
- Cache utilization
Additional Resources
Monitoring Tips
- Regular space checks
- Inode monitoring
- Alert thresholds
- Trend analysis
- Capacity planning
Best Practices
- Use human readable format
- Check both space and inodes
- Monitor critical filesystems
- Document thresholds
- Regular maintenance