Learn how to get a quick, human‑readable snapshot of disk space across all filesystems with the df -h command. We’ll contrast it with du, ls, and stat to show why df is the go‑to for overall space monitoring and reporting.

Multiple Choice

Which command provides a summary of disk space usage on all filesystems?

The command that provides a summary of disk space usage on all filesystems is "df -h." The "df" command stands for "disk free" and is used to report the amount of disk space used and available on filesystems. When the "-h" option is added, it formats the output in a human-readable form, displaying sizes in kilobytes (K), megabytes (M), or gigabytes (G) as appropriate. This command is particularly useful for system administrators who need to quickly assess how much space is utilized and how much is available across all mounted filesystems. It summarizes total space, used space, available space, and the mount points for each filesystem. In contrast, the other commands serve different functions: - "du -h" displays the disk usage of a specific directory and its contents, rather than providing an overview of all filesystems. - "ls -lh" lists files and directories in the current directory along with their sizes, but it does not provide information on filesystem usage. - "stat" provides detailed information about a specific file or filesystem object, rather than a summary of usage across all filesystems. This distinction makes "df -h" the appropriate choice for summarizing disk space

Disk space is a quiet but stubbornly persistent itch for many admins and everyday users alike. You want to know what’s taking up space, where the space is, and whether you’ve got room to spare for that new project, a software update, or a pile of logs that somehow grew overnight. In the Linux world, a few simple commands do the heavy lifting, and one of them stands out when you need a high-level view of all mounted filesystems: the df command with a human-friendly flag.

Let me explain the essentials without the drama. The df command, short for “disk free,” is designed to answer a straightforward question: How much space do I have across every mounted filesystem? It’s the go-to tool when you want a bird’s-eye view, not a deep dive into every directory’s footprint. When you tack on the -h option, you get sizes that humans can grok at a glance—Kilobytes, Megabytes, Gigabytes—so you don’t have to strain your eyes trying to parse a sea of blocks and bytes.

Why df -h is so handy

  • It covers all mounted filesystems: root, partitions, external drives, network shares, and even some special virtual filesystems. If it’s mounted, df will include it.

  • It provides the essentials in a compact table: filesystem, size, used, avail, and the mounted location. The numbers tell a story at a glance—how full is each filesystem, and where is the bottleneck?

  • It’s lightweight and fast. You can run it in a pinch during a moment of urgency or schedule it as part of routine health checks.

If you’ve ever used Linux in the trenches, you’ve probably run df more times than you’ve rebooted. It’s the kind of tool you learn to glance at quickly, then glance again, like checking the fuel gauge on a car before a long road trip. A little more context: df can be told to show sizes in human-readable form with -h, but it also accepts other options that tailor the report, such as -T to show filesystem types or -i to report inodes instead of block usage. For practical daily use, -h is the one most people reach for first.

A quick guide to what df is showing

  • Filesystem: the name of the device or remote filesystem, such as /dev/sda1 or tmpfs.

  • Size: the total capacity of that filesystem.

  • Used: how much space is currently used.

  • Available (Avail): how much space remains for non-root users (some systems reserve a percentage for root; df will reflect that if applicable).

  • Mounted on: the path in the directory tree where this filesystem is attached.

A small story about nuance

Sometimes you’ll notice a discrepancy between what df shows and what you saw when you wrangled the folder you suspect is hogging space. You might have a directory full of large files that are deleted but still held open by a running process. In those cases, the disk space is technically still used until the process closes the file handle. df doesn’t know about file handles being open or closed; it reflects the state of the filesystem itself. For that, you might pair df with tools like lsof to see which processes are keeping files alive, or use du to inspect specific directories after you’ve dealt with the immediate culprits.

A few practical tips that keep you from getting tripped up

  • Human-readable matters: Always use df -h for a quick view. If you’re scripting, you might switch to df -k (kilobytes) or df -B1 to get raw numbers, then format them in your shell.

  • Root and reserved space: Some filesystems reserve a percentage for root. On systems with tight space, that reserved area can be invisible to regular users but visible to df, so you’ll sometimes see “Avail” smaller than you expect. If you’re managing a server with strict quotas, you’ll want to be mindful of this nuance.

  • Different filesystems, different quirks: ext4, xfs, btrfs, and others all report slightly differently in edge cases. If you’re diagnosing space in a RAID or a networked filesystem, take a moment to note the type with df -T to avoid misreading a result.

  • Regular monitoring: A quick cron job that runs df -h and emails you the gist of the report can save you from creeping doom when a logrotate run hits a wall or a user account caches logs faster than expected.

What about the other commands you might be tempted to reach for?

  • du -h: This is the space used by a directory and everything beneath it. It’s excellent when you want to know which subfolders are eating up space, but it doesn’t summarize the entire system. Think of it as a flashlight for a particular corner of the room rather than a ceiling-wide overview.

  • ls -lh: Lovely for file-by-file size in a given directory, but it won’t tell you how much space the entire filesystem commands you to share. It’s more about the micro view—the size of items you’re looking at now.

  • stat: This one’s powerful, providing details about a file or filesystem object, but the scope is granular. It’s not a dashboard for space usage; it’s a precise instrument for inspecting a specific item.

If you’re curious about real-world workflows, here’s a simple, everyday scenario that many people relate to: you’re chasing a sudden spike in disk usage after an automated log rotation ran but didn’t reclaim space. You run df -h to get the big picture first. You spot that /var has grown unusually large. Then you switch gears to du -h /var to identify which subdirectories are the culprits. You might discover that a log directory has exploded due to a verbose logging setting in a service. You adjust the log level or rotate logs more aggressively, and you verify the effect with another df -h. It’s a small loop, but it keeps systems running smoothly without guesswork.

Beyond the basics: a few extra knobs that come in handy

  • df -hT: Adds the filesystem type to the report. If you’re on a diverse server with ext4, xfs, and network-backed mounts, this can be incredibly informative at a glance.

  • df -i: If you’re worried about running out of inodes (the tiny data structures that track files, not just their space), this flag shows inode usage across filesystems. It’s a reminder that disk space isn’t the whole story—some filesystems can be almost full in inodes even if there’s space left.

  • df --output: You can tailor the exact columns you want to see. This is handy when you’re piping results into logs or other scripts and you want a clean, predictable format.

A moment of perspective

Learning to read disk space reports is a bit like reading a car’s dashboard. There are gauges you glance at often (the big ones) and little indicators you check when something feels off. df is that broad, reliable dashboard—your first stop for understanding how much breathing room you’ve got across the machine’s storage landscape. It’s not flashy, but it’s dependable, and in system administration, dependable is a superpower.

A good practice to keep in mind

  • When you’re doing routine maintenance or responding to a space crunch, start with df -h to establish the lay of the land. If you see a filesystem nearing capacity, drill down with du or a targeted ls for the directories you suspect. If you need to investigate usage patterns over time, consider logging df -h outputs periodically and charting them. A simple CSV over days or weeks can reveal trends you’d otherwise miss in a one-off glance.

Where to go next, in plain terms

If you want to become fluent in space diagnostics, try these steps in succession:

  • Run df -h to get a quick read on every mounted filesystem.

  • If something looks tight, run df -i to check inode usage and see if you’re hitting inode limits.

  • Pick a likely culprit directory and run du -h on it, perhaps with --max-depth to avoid floods of output.

  • If you’re troubleshooting a stubborn case, combine commands: df -hT shows types; du -h --max-depth=1 points to the heaviest subdirectories; and lsof can reveal processes holding onto deleted files.

A gentle wrap-up

Disk management is less about drama and more about steady, informed actions. df -h is a companion you’ll reach for again and again because it distills complexity into a readable snapshot. It’s the kind of tool that feels almost familiar after a while—like you’re checking a familiar room, not venturing into a maze.

If you’re exploring Linux with curiosity, you’ll soon appreciate the elegance of these simple commands. They don’t pretend to solve every storage puzzle, but they give you a trustworthy map. And with that map, you can keep systems healthy, responsive, and ready for whatever your next project might be.