What is df in linux

Last updated: April 1, 2026

Quick Answer: df (disk free) is a fundamental Linux command that displays the amount of disk space used and available on mounted filesystems, showing total size, used space, available space, and percentage utilization for each partition.

Key Facts

Overview of the df Command

The df command, short for "disk free," is one of the most fundamental utilities in Linux and Unix system administration. It provides a comprehensive overview of disk space utilization across all mounted filesystems, making it essential for monitoring storage capacity, diagnosing disk space problems, and planning infrastructure upgrades. Whether you're managing a personal computer or a large-scale server infrastructure, df is typically one of the first commands administrators use to assess disk health.

Basic Usage and Output

Running the simple command df in a terminal displays a table with information about all mounted filesystems. Each row represents a different partition or logical volume, showing the device path, total size, used space, available space, usage percentage, and mount point. By default, sizes are displayed in 1024-byte blocks, which results in large numbers that aren't intuitive for humans. For this reason, most administrators use the -h flag to display sizes in human-readable format: df -h.

Understanding the Columns

The standard df output contains several important columns. The Filesystem column shows the device file or logical volume name. The Size column displays total capacity, while Used shows space currently occupied by files and data. The Available column indicates free space accessible to regular users, which may differ from total free space due to reserved space for the root user. The Use% percentage helps quickly identify nearly-full partitions, and Mounted on shows where each filesystem is attached in the directory structure.

Advanced Options and Variations

The df command supports numerous options for different situations. The -T option adds a column showing the filesystem type (ext4, NTFS, XFS, btrfs, etc.), helpful for understanding your storage infrastructure. The -i flag switches the display to show inode usage instead of disk space, useful when troubleshooting issues where inodes are exhausted despite having disk space available. The -l option restricts output to local filesystems, excluding remote NFS or Samba mounts, which is useful in network environments. Options can be combined, such as df -hT to show both human-readable sizes and filesystem types.

Practical System Administration Applications

System administrators use df in multiple contexts. Regular manual checks help identify when storage upgrades are needed, typically when usage approaches 80-90% capacity. More importantly, df is incorporated into monitoring scripts and cron jobs that automatically track disk usage over time and alert administrators when thresholds are exceeded. Shell scripts can parse df output to implement automated cleanup procedures, archive old files, or trigger escalation procedures when critical disk space levels are reached.

Comparison with Related Commands

While df shows filesystem-level disk usage, the du command provides a complementary view by showing space consumed by specific directories and files. Together, these tools help administrators understand both overall filesystem health and where disk space is actually being consumed. The ncdu tool offers an interactive visualization of directory sizes, and modern tools like dfc provide colorized output, but df remains the universal standard across all Unix-like systems.

Related Questions

What is the du command in Linux?

The du (disk usage) command shows space consumed by specific directories and files, complementing df which shows filesystem-level usage. Together they provide complete disk usage visibility.

How do I find large files in Linux?

Use find combined with file size options, or du to identify space-consuming directories, then ls -lah to examine specific large files consuming storage.

What does the 'Avail' column mean in df output?

The Available column shows free space accessible to regular users, which may be less than total free space because some space is reserved exclusively for the root user.

Sources

  1. Linux Manual Pages - df(1) Official Reference GPL
  2. GNU Coreutils Documentation - df Command GFDL