CloudsArk
Commands Linux

df Command Examples in Linux

Practice useful df command examples for everyday Linux administration and troubleshooting.

df Command Examples in Linux

Introduction

These examples show practical ways to use df on a Linux terminal. Each example is written so you can adapt it for administration or troubleshooting.

Example 1: Basic Usage

df

This is the simplest form of the command and is a good starting point before adding options.

Example 2: Common Admin Task

df -h

This example reflects a common task on RHEL, Rocky Linux, AlmaLinux, or similar systems.

Example 3: Useful Option

df -h /var

This option helps narrow the result, change behavior, or handle a more realistic target.

Example 4: Real-World Scenario

df -Th

Use this pattern when the task moves beyond a single basic command.

Example 5: Verification

findmnt /var

Example output:

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

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
df -h /var
df -Th
findmnt /var

Summary

Good df usage means choosing the right option, keeping the target clear, and verifying the result with output you can explain.