DF explained checking your Linux system disk usage #shorts #linux

Published: December 1, 2025 (Updated: Dec 1, 2025)

Enjoying this content? Subscribe to the Channel!

Mastering the ‘df’ Command: Your Essential Guide to Checking Linux Disk Space


Introduction: Why Disk Space Management Matters

Welcome back to Darren’s Tech Tutorials! As any seasoned system administrator or dedicated Linux enthusiast knows, managing disk space isn’t just a chore—it’s essential for system health and stability. If your root partition unexpectedly fills up, your system can grind to a halt.

Fortunately, Linux gives us a powerful, built-in tool to keep an eye on things: the df command.

The df command (short for “Disk Free”) is your go-to utility for viewing detailed information about file system usage, including total disk space, used disk space, and available disk space across every mounted file system.

In this guide, we’ll break down the df command, starting with the basics and moving into the powerful options that will make you a disk space monitoring pro!

Understanding the Basic df Command

When you simply type df and hit Enter, the system returns information on all currently mounted file systems.

The default output is comprehensive, showing five main columns:

  1. Filesystem: The name of the file system (e.g., /dev/sda1).
  2. 1K-blocks: The total size of the file system, usually displayed in 1-kilobyte blocks.
  3. Used: The amount of space currently in use.
  4. Available: The remaining space available for use.
  5. Use%: The percentage of disk space currently utilized.
  6. Mounted on: Where the file system is mounted in the directory structure.

While that default output is accurate, those large block numbers can be tough to read. That brings us to our most essential option!

Essential df Options for Daily Use

To truly make the df command useful for day-to-day operations, you need to display the results in a format that humans can instantly understand.

Option 1: Human-Readable Format (-h)

This is the most common and arguably the most important option you’ll use. The -h flag converts those confusing 1K block numbers into easily digestible units like Gigabytes (G), Megabytes (M), or Kilobytes (K).

Command:

df -h

What it does: This command displays disk space statistics in a “human-readable” format, making it effortless to see exactly how much space you have left (e.g., 20G instead of 20,000,000).

Option 2: Limiting Output by File System Type (-t)

Sometimes you only care about specific types of partitions, like standard journaled file systems (e.g., ext4) and want to filter out temporary systems like tmpfs. The -t option allows you to limit the output to a specific file system type.

Command Example (to view only ext4 systems):

df -t ext4

What it does: This command filters the list to show information only for mounted file systems identified as type ext4. This is extremely helpful when troubleshooting specific storage drives.

Advanced Techniques: Customizing and Targeting

Beyond the basics, the df command offers powerful ways to customize what information you see and where you look.

Targeting a Specific Device

If you are only interested in the usage of one particular partition, you can specify the device path directly.

Command Example:

df /dev/sda1

What it does: This command displays information only on the file system mounted at /dev/sda1. This streamlines your analysis when diagnosing issues on a single drive.

Customizing the Output Format (--output)

For scripting, reporting, or just getting quick, precise data, you might not want all six default columns. The --output argument allows you to customize exactly which columns are displayed and in what order.

Available fields include: source, size, used, avail, pcent, target (and others).

Command Example:

df --output=source,size,used,avail

What it does: This command customizes the output format to display only the file system name (source), total size (size), used space (used), and available space (avail) for each file system. This is perfect for generating clean, targeted reports.

Summary of Key df Command Options

Option Description Example
(None) Displays usage statistics for all mounted file systems. df
-h Displays sizes in a human-readable format (e.g., G, M). df -h
-t Limits output to a specific file system type. df -t xfs
–output Customizes the columns displayed in the report. df --output=size,used
[DEVICE] Displays information only for a specific device. df /dev/sdb1

Conclusion: Take Control of Your Disk Space

The df command is an indispensable part of the Linux toolkit. By mastering the -h flag for readability, the -t flag for filtering, and the advanced --output option for precision, you gain full control over monitoring your system’s storage health.

Now that you know how to wield this power, fire up your terminal and check your disk usage! Knowing where your space is going is the first step toward efficient system maintenance.

Did this tutorial help you clean up some clutter or diagnose a storage issue? Let us know in the comments below! And don’t forget to like this post and subscribe to Darren’s Tech Tutorials for more clear, accessible Linux guides!