df Linux Command
Reports disk space usage for all mounted filesystems (human-readable with -h).
What does df do?
Reports disk space usage for all mounted filesystems (human-readable with -h).
Syntax
df [options]Practical example
df -hQuestions about df
How do I check disk space usage?
Use `df -h` to see disk space usage in human-readable format (GB, MB). This shows all mounted filesystems.
What does df -h show?
It shows filesystem, size, used space, available space, use percentage, and mount point for each mounted filesystem.
How do I check disk usage for a specific mount?
Use `df -h /home` to check disk usage for the filesystem that contains /home.
How do I see only local filesystems?
Use `df -hT` to show filesystem types, or `df -h --type=ext4` to filter by specific filesystem type.
How do I check inode usage?
Use `df -i` to see inode usage instead of block usage. This shows how many file entries are used vs available.
How do I see disk space in megabytes?
Use `df -BM` to display sizes in megabytes. Use `-h` for auto-scaling to the most appropriate unit.
How do I see the total disk usage?
Use `df -h /` to see disk usage for the root filesystem. Combine with `du` for directory-level usage.
How do I see which filesystem a directory is on?
Use `df /path/to/directory` to see which filesystem contains that directory and its usage.
Related Disk Commands
ncduInteractive disk usage analyzer with a terminal UI (ncurses-based).
duEstimates file and directory space usage (disk usage).
partedDisk partitioning tool (supports GPT and MBR partition tables).
fdiskManipulates disk partition table (create, delete, resize partitions).
blkidDisplays block device attributes including UUID and filesystem type.
mountMounts a filesystem (attaches a device to the directory tree).