In the realm of computing, particularly within Unix-like operating systems such as Linux and macOS, the seemingly simple command df holds immense power and utility. df stands for “disk free,” and its primary purpose is to display the amount of available disk space usage for file systems on the operating system. Far from being a mere reporting tool, df is a foundational utility for system administrators, developers, and power users alike, providing critical insights into storage health, performance, and capacity planning. Understanding df is not just about knowing a command; it’s about comprehending a fundamental aspect of system resource management.

The Core Function of df: Monitoring Storage
At its heart, df serves as a diagnostic window into how disk space is allocated and utilized across various mounted file systems. Every operating system relies heavily on its storage infrastructure, and knowing how much free space remains is crucial for operational stability and data integrity.
A Command-Line Utility’s Legacy
The df command traces its origins back to the early days of Unix. Born from the necessity to manage finite and often expensive storage resources, it has been a staple in system administration toolkits for decades. Its presence in virtually every Unix-like environment underscores its enduring relevance. Unlike graphical interfaces that might abstract away the underlying details, df provides a direct, tabular representation of disk space, allowing for precise and immediate analysis. Its command-line nature also makes it highly scriptable, enabling automation of storage checks and alerts.
Why Disk Space Matters
The availability of disk space directly impacts a system’s performance and reliability. A server running out of disk space can lead to catastrophic failures: applications crashing, logs failing to write, databases becoming unresponsive, and even the operating system itself ceasing to function. For personal computers, full disks result in slowdowns, inability to install new software, or store new files. df helps proactively identify low-space conditions before they escalate into critical issues, enabling timely intervention such as cleaning up old files, expanding storage, or offloading data.
Basic Syntax and Usage
The most fundamental way to use df is simply to type it into a terminal:
df
Executing this command without any arguments will output a list of all mounted file systems, along with their size, used space, available space, percentage of usage, and the mount point. However, this default output can sometimes be challenging to read due to block sizes being reported in raw kilobytes or 512-byte blocks. For more user-friendly output, the -h (human-readable) option is almost universally preferred:
df -h
This command displays sizes in powers of 1024 (GiB, MiB, KiB), making the output much easier for humans to interpret at a glance. For instance, instead of 104857600, you might see 100G.
Diving Deeper: Key df Options and Their Insights
While df -h is the workhorse for daily checks, the df command boasts a rich set of options that unlock more granular insights and allow users to tailor its output to specific needs. These options transform df from a simple reporting tool into a powerful diagnostic utility.
Human-Readable Output (-h)
As mentioned, the -h option (--human-readable) is invaluable for quickly understanding disk usage. It automatically scales numbers to the most appropriate unit (K, M, G, T, P, E, Z, Y). This convenience greatly reduces cognitive load when scanning through multiple file systems, especially in environments with diverse storage capacities.
Displaying Inodes (-i)
Beyond raw disk space, file systems also have a finite number of “inodes.” An inode is a data structure that stores information about a file or directory, such as its permissions, ownership, timestamp, and physical location on the disk. Even if a disk has ample free space, running out of inodes can prevent new files or directories from being created. This is particularly common in systems that store millions of tiny files (e.g., mail servers, web caches). The -i (--inodes) option reports inode usage:
df -i
This output provides columns for total inodes, used inodes, free inodes, and the percentage of used inodes, offering a critical dimension to storage health assessment.
Including Pseudo Filesystems (-a)
By default, df typically omits pseudo file systems (e.g., procfs, sysfs, tmpfs, devtmpfs). These are special file systems that don’t represent actual disk space but rather provide interfaces to kernel data structures or RAM-based temporary storage. While usually not relevant for disk space monitoring, there are scenarios where including them might be useful for a comprehensive view. The -a (--all) option ensures all file systems are listed:
df -a
Showing Filesystem Type (-T)
Different file systems have different characteristics and are optimized for various use cases. Knowing the type of file system (e.g., ext4, XFS, Btrfs, NTFS, NFS, ZFS) can be crucial for troubleshooting or understanding performance expectations. The -T (--print-type) option adds a ‘Type’ column to the output:
df -T
This is particularly useful in mixed environments or when dealing with network-mounted shares, where identifying the protocol (NFS, CIFS) is important.
Limiting Output to Specific Types (-t and -x)
For focused analysis, df allows filtering by file system type.
The -t (--type=TYPE) option includes only file systems of a specified type:
df -t ext4

Conversely, the -x (--exclude-type=TYPE) option excludes file systems of a specified type, which is useful for filtering out noise from pseudo file systems or network mounts if only local disk usage is of interest:
df -x tmpfs -x devtmpfs
Understanding Block Sizes (-k, -m, -B)
While -h offers convenience, sometimes precise, fixed-unit reporting is required. df allows specifying the block size for its output:
-k: Report in 1K-byte blocks (default for many systems).-m: Report in 1M-byte blocks.-B SIZE: Report in SIZE-byte blocks. For example,df -B 1Gwould show sizes in 1-gigabyte units.
These options are helpful for scripting or when comparing against specifications that use a specific unit.
Interpreting df Output: What the Columns Mean
Regardless of the options used, df‘s output follows a consistent columnar structure. Understanding each column is key to extracting meaningful information.
- Filesystem: This column typically identifies the device node (e.g.,
/dev/sda1,/dev/nvme0n1p2) or the source of a mounted file system (e.g.,tmpfs,server:/path/to/share). It tells you what storage resource is being reported. - Size: This is the total capacity of the file system, usually reported in the specified block size or human-readable format. It represents the maximum amount of data that can be stored on that particular mount point.
- Used: This column shows the amount of disk space currently occupied by files and directories within that file system.
- Avail: This is the amount of disk space that is available for use by unprivileged users. It’s important to note that Linux file systems often reserve a small percentage (typically 5%) of the total disk space for the root user. This reservation helps prevent the disk from becoming completely full, which could lead to system instability, and ensures the root user can still log in and perform maintenance tasks.
Availusually reflects the space available after this reservation. - Use%: This is the percentage of the disk space that is currently used, relative to the total available to non-root users. A
Use%of 100% indicates that the file system is full, potentially preventing new data from being written and impacting system operations. - Mounted on: This crucial column indicates the mount point—the directory in the file system hierarchy where the specified
Filesystemis attached and accessible. For instance,/is the root file system,/homeis where user directories typically reside, and/varoften contains logs and variable data. - Inodes (if
-iis used): When the-ioption is used, additional columns forInodes,IUsed,IFree, andIUse%are displayed, providing insight into inode utilization, similar to how disk space is reported.
Practical Applications and Troubleshooting with df
df is not just for passive monitoring; it’s a critical tool in a system administrator’s troubleshooting arsenal.
Identifying Storage Bottlenecks
High Use% values immediately flag potential storage bottlenecks. If /var is consistently at 90% or higher, it might indicate excessive logging. If /home is full, users might be hoarding large files. df quickly points to the problematic file system, allowing administrators to investigate further with tools like du (disk usage) to pinpoint the specific files or directories consuming space.
Preventing System Crashes
A full root file system (/) can halt an entire system. By regularly checking df, administrators can set up alerts when Use% approaches critical thresholds (e.g., 85% or 90%), allowing them to intervene before a crash occurs. This proactive approach saves countless hours of downtime and avoids data loss.
Managing Log Files and Temporary Data
Log files, especially those from busy applications or systems, can grow rapidly, consuming vast amounts of disk space in /var/log. Similarly, temporary directories (/tmp or /var/tmp) can accumulate stale data. df helps monitor these specific partitions, prompting actions like log rotation configuration, cleanup scripts, or increasing partition size.
Monitoring Network File Systems (NFS/SMB shares)
In environments relying on network-attached storage, df can be used on client machines to view the disk space on remote shares. This allows for centralized monitoring of storage resources even if they are physically located elsewhere. For example, df -h /mnt/nfs_share provides information about the mounted NFS share directly from the client.
Complementary Tools: du vs. df
It’s important to differentiate df from its close cousin, du.
df(disk free) reports on disk space allocated to the file system as seen by the operating system. It works by querying the file system structure itself.du(disk usage) estimates file space usage by walking the directory tree. It sums up the sizes of individual files and directories.
While df tells you the total capacity and available space of a mounted partition, du tells you how much space a specific directory or file is consuming. They are often used in conjunction: df to identify a full partition, and du to find out what is filling it up.
Beyond the Command Line: Graphical Tools and Future Trends
While df remains a powerful command-line utility, its underlying principles are adopted in various graphical and modern storage management tools.
Desktop Environments and df‘s Principles
Modern desktop environments like GNOME, KDE, or macOS Finder offer graphical utilities that present disk usage information in an intuitive way. Tools like GNOME Disks or Disk Usage Analyzer (baobab) provide a visual representation of disk space, often using treemaps or pie charts. These tools essentially execute df-like operations in the background and present the data in a more user-friendly format, abstracting away the command-line details for average users.
Cloud Computing and Storage Monitoring
In cloud environments (AWS, Azure, Google Cloud), storage is often abstracted further into services like EBS volumes, Azure Disks, or S3 buckets. While you might not run df directly on an S3 bucket, df is still critical on virtual machines (EC2 instances, Azure VMs) attached to these cloud storage volumes. Cloud monitoring services often collect df-like metrics (used vs. free space) to provide dashboards and alerts, mirroring the core functionality df offers on traditional bare-metal servers. The concept of monitoring available capacity remains universal, even as the underlying storage infrastructure evolves.
Automation and Scripting
The output of df is highly parsable, making it ideal for integration into scripts. System administrators frequently write scripts that parse df‘s output to:
- Generate daily or weekly storage reports.
- Trigger alerts via email or messaging platforms when disk usage exceeds a threshold.
- Automatically clean up temporary files or old logs when space runs low.
- Adjust storage allocations in dynamic environments.
This scripting capability extends df‘s utility far beyond manual checks, enabling robust, automated storage management.

The Evolving Landscape of Storage
As storage technology advances, from traditional HDDs to NVMe SSDs, and from local file systems to distributed object storage and hyperconverged infrastructure, the need to understand available capacity persists. While specific commands or interfaces might change, the core concept that df embodies—the ability to query and report on the free space of a mounted storage resource—remains a cornerstone of efficient and reliable computing infrastructure. df provides a simple yet profound insight into one of the most vital resources of any computing system, ensuring its continued stability and performance.
