df – Report File System Disk Space Usage
The df command displays information about the amount of disk space available and used on mounted file systems.
Syntax
df [OPTION]... [FILE]...
- If no file or directory is specified,
dfreports on all mounted file systems.
Options
| Option | Description |
|---|---|
-h |
Human-readable format (e.g., 1K, 234M, 2G) |
-H |
Human-readable format using powers of 1000 (e.g., 1k, 234M) |
-T |
Display the type of each file system |
-a |
Include dummy file systems |
-i |
Show inode usage instead of block usage |
-t TYPE |
Limit output to file systems of type TYPE |
-x TYPE |
Exclude file systems of type TYPE |
Practical Examples
1. Show disk usage of all mounted file systems
df
2. Display disk usage in human-readable format
df -h
Output example:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 100G 60G 35G 64% /
tmpfs 7.8G 1.2M 7.8G 1% /run
3. Show file system types
df -T
4. Show inode usage instead of block usage
df -i
5. Display disk usage for a specific directory or mount point
df -h /home
Tips
- Use
df -hfor easy-to-read sizes. - To check disk space before installing software or copying large files.
- Combine with
grepto filter specific file systems, e.g.,
df -hT | grep ext4
See Also
du– estimate file and directory space usagemount– display mounted file systemslsblk– list information about block devices
Summary
df is a handy command to quickly check disk space usage and available capacity across file systems, helping monitor storage health and capacity.