Linux Terminal Command: df

The df command is an essential tool in System Information & Hardware. In this tutorial, we will explore what df does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.


Concept & Explanation

The df command displays the total size, used space, available space, and mount points of all active filesystems.


Common Options & Syntax

df [options] [arguments]

Here are the most common flags used with df:


1. Interactive Example (Simple)

Here is how most people run the command:

# Example
df -h

What it does: Displays disk usage details in human-readable formats (e.g. GB, MB).


2. Power-User Example (Advanced)

For scripting and advanced diagnostics, use this configuration:

# Advanced
df -lhT -x tmpfs -x devtmpfs

What it does: Filters out temporary filesystems (tmpfs) and displays disk types (-T) for local physical storage only.


⚙️ Warning & Common Pitfalls

[!WARNING] On systems with hung network mounts (like NFS), running df can hang indefinitely. Use df -l to query local filesystems only.


Here are some related posts on cli_tty1 you might want to check out: