CloudsArk
Commands Linux

What Is the df Command in Linux?

Learn what the df command does in Linux, how its syntax works, and when to use it.

What Is the df Command in Linux?

Introduction

The df command reports filesystem space usage. It is useful for beginners, Linux administrators, DevOps engineers, and RHCSA students because it solves practical terminal tasks.

What the Command Does

Use df to work with the specific Linux object it manages. Before changing anything, identify the target and run a read-only check when possible.

Basic Syntax

df OPTIONS PATH

The syntax includes the command, any options, and the target object.

Common Options

  • -h: show human-readable sizes.
  • -T: show filesystem type.
  • -i: show inode usage.

Practical Examples

df
df -h
df -h /var
df -Th

Verification command:

findmnt /var

Example output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   50G   18G   33G  36% /

When to Use This Command

Use df when you need to know whether a filesystem is full or how much capacity remains on a mounted filesystem.

Common Mistakes

  • Confusing filesystem usage from df with directory size from du.
  • Ignoring inode exhaustion when block space is still available.
  • Checking the wrong mount point after bind mounts or separate filesystems.

Quick Reference

df
df -h
findmnt /var

Summary

The df command is safest when you understand the target, choose the right option, and verify the result with a separate command.