Home / Blog / df -h Command in Linux: Check Disk Space in Human-Readable Format

df -h Command in Linux: Check Disk Space in Human-Readable Format

The Linux df -h command provides a quick and easy way to check disk space usage in a human-readable format. Learn how to use it, understand its output, and monitor storage on Linux systems.

df -h Command in Linux: Check Disk Space in Human-Readable Format

df -h Command in Linux

Managing disk space is an important part of Linux server administration. When storage becomes full, applications may stop working correctly and system processes can be affected.

The df -h command is a simple way to check available and used disk space. The -h option displays the values in a human-readable format, making the output easier to understand.

Solace Infotech's sitemap includes Linux disk-space and system-monitoring topics as part of its technical content.

What Is the df -h Command?

df stands for disk filesystem. It reports filesystem disk-space usage.

The basic command is:

 
df -h
 

The -h option displays values using readable units such as KB, MB, GB, or TB.

Understanding the Output

A typical output may look like:

 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        50G   30G   18G  63% /
 

The columns provide useful information:

Filesystem – The filesystem being reported.

Size – Total filesystem capacity.

Used – Space currently being used.

Avail – Space available for use.

Use% – Percentage of space being used.

Mounted on – The directory where the filesystem is mounted.

Check a Specific Directory

You can also check the filesystem associated with a particular directory:

 
df -h /var
 

This is useful when troubleshooting storage-related problems in directories such as /var, /home, or /tmp.

Why Use df -h?

The command is useful for:

  • Checking available server storage.
  • Finding filesystems nearing capacity.
  • Troubleshooting disk-space problems.
  • Monitoring production servers.
  • Quickly reviewing storage usage.

For everyday Linux administration, df -h is one of the most useful commands to remember.

df -h vs du -h

The two commands answer different questions.

df -h shows filesystem-level disk usage.

du -h helps identify how much space individual directories and files are consuming.

For example:

 
du -sh /var/log
 

You can use df -h first to identify a full filesystem and then du to investigate which directories are using the most space.

Best Practices

Check disk usage regularly on servers that generate large logs, store uploads, or process large amounts of data.

When a filesystem reaches high utilization, investigate the cause before deleting files. Removing system or application files without understanding their purpose can cause unexpected problems.

Conclusion

The df -h command is a simple and powerful Linux utility for monitoring disk space. Its human-readable output makes it easy to identify total, used, and available storage.

By combining df -h with commands such as du, developers and system administrators can quickly diagnose and manage disk-space issues.

Contact Us

1119 W Duarte Rd, Arcadia, CA 91007

Solace Infotech Pvt. Ltd, Supreme HQ,
          HQ3C+9F2, Yash Orchid Society,
          Baner, Pune, Maharashtra 411021

4th Floor, Samraat Nucleus,
           Mumbai Naka, Nashik - 422001