October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Check Disk Space on Linux from the Command Line

Use df for mounted-filesystem capacity and du to investigate directory usage. Learn the key options, unit conventions and reasons the results may differ.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use df -h to see available space on mounted filesystems, and du to find how much space files and directories under a particular path use. The two commands answer different questions: one reports filesystem capacity; the other estimates usage within a directory tree.

Check available space with df

Run this for a human-readable overview of mounted filesystems:

df -h

GNU df displays sizes using powers of 1024 with -h. Its output includes the filesystem, total size, used space, available space, percentage used and mount point. To check the filesystem that contains a particular location, give df a path:

df -h /var

Use a directory such as / or /var rather than assuming a device name is the right target. Without an argument, df reports mounted filesystems; it does not inspect filesystems that are not mounted. GNU df uses powers of 1000 for its human-readable -H option instead of powers of 1024. See the GNU Coreutils documentation for df for option details. Other implementations and older versions may differ, so check the local manual if an option is unavailable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Find which directories use space with du

To get one total for a directory, use -s for a summary and -h for human-readable sizes:

du -sh /path/to/directory

To see entries below that directory rather than a single total, run:

du -h /path/to/directory

With GNU du, --max-depth=1 limits the report to the directory and its immediate children, which is often a useful first step when investigating a large tree:

du --max-depth=1 -h /path/to/directory

GNU du also supports --si for human-readable sizes using powers of 1000. Consult the GNU Coreutils documentation for du for the precise behavior of these options.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

List large entries as a quick diagnostic

This pipeline prints numeric sizes and paths, sorts the entries from largest to smallest, and shows the first ten:

du -a /path/to/directory | sort -n -r | head -n 10

It is a quick way to spot large entries, not a polished or universally portable report. Very large trees can take time to scan; permission errors may leave some paths uncounted, and filenames, locale settings or differences among command implementations can affect the output. Use it as a lead, then inspect the specific paths with du.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why df and du can disagree

df reports filesystem-level capacity and availability, while du estimates usage from file information reported by the operating system. Their results are not interchangeable measures of the same thing. Hard links, copy-on-write behavior, compression, network filesystems and filesystem metadata can all affect the relationship between a directory scan and device consumption. Access restrictions or differences in which paths are mounted can also keep a scan from accounting for everything shown by df.

If a filesystem looks full in df but a du scan does not explain the usage, treat the results as complementary clues: confirm you scanned the relevant mounted paths and consider filesystem behavior and access limits before concluding that space is missing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Background and compatibility

The Linux Foundation republished Jack Wallen’s Linux.com archive article on January 7, 2022, describing df as an overview of disk usage and du as a way to discover usage by directory. The commands are standard utilities commonly available on Linux systems, including headless setups; the article used Elementary OS as its example. The current GNU Coreutils documentation is version 9.11, but that does not mean every Linux distribution ships that release. For a broader introduction, the Linux Foundation article links to its free Introduction to Linux course.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.