H
10Corp Premium Hosting

The df (Disk Filesystem) Command

Last Updated: 2025-01-01 3 min read

Overview

The df (disk filesystem) command reports how much disk space is used and available on mounted filesystems. While du shows the size of specific directories, df gives you the big picture of your entire disk or partition.

Basic Syntax

df [options] [filesystem]

Running df without arguments shows all mounted filesystems.

Common Usage Examples

Human-Readable Disk Space Overview

df -h

Sample output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        50G   32G   16G  67% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
/dev/sda2       200G  145G   45G  77% /home

Understanding the Output Columns

ColumnDescription
FilesystemThe name of the storage device or partition
SizeTotal capacity of the filesystem
UsedAmount of space currently in use
AvailFree space remaining
Use%Percentage of the filesystem that is used
Mounted onThe directory where the filesystem is accessible

Check a Specific Filesystem or Path

df -h /home

This shows only the filesystem that contains /home, which is helpful when you want to check a specific partition.

Display Filesystem Type

df -hT

The -T flag adds a Type column showing the filesystem type (ext4, xfs, tmpfs, etc.):

Filesystem      Type  Size  Used Avail Use% Mounted on
/dev/sda1       ext4   50G   32G   16G  67% /
/dev/sda2       xfs   200G  145G   45G  77% /home

Useful Flags Reference

FlagDescription
-hHuman-readable sizes (KB, MB, GB)
-HHuman-readable using powers of 1000 instead of 1024
-TShow filesystem type
-iShow inode usage instead of block usage
-aInclude pseudo, duplicate, and inaccessible filesystems
-t TYPEShow only filesystems of a specific type
-x TYPEExclude filesystems of a specific type
--totalAppend a grand total row

Practical Use Cases

Monitor overall server disk usage

df -h --total

This appends a total row summarizing all filesystems.

Check inode usage

Sometimes you run out of inodes (file entries) before running out of space. This is common when a directory contains millions of small files (e.g., mail or cache directories):

df -ih
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/sda1        3.2M  420K  2.8M   13% /
/dev/sda2         13M  1.1M   12M    9% /home

Filter output to real (non-tmpfs) filesystems

df -h -x tmpfs -x devtmpfs

df vs. du

ToolPurpose
dfShows total, used, and free space for entire filesystems/partitions
duShows how much space specific directories or files consume

Use df -h first to see if a partition is running low, then use du to investigate which directories are the largest consumers.

Tips

  • On shared hosting, df output may be limited or show the entire server’s disk — your hosting provider may offer a disk usage widget in cPanel for account-level details.
  • If Use% is above 90%, take action immediately by cleaning up old backups, logs, or temporary files.
  • If inode usage (df -i) is high, look for directories with excessive small files such as cache or session directories.
Tags: ssh linux disk-space df

Still need help?

Our support team is available 24/7 to assist you.