Back to commands

Web Server Rescue

Read-only

Check Filesystem Space with df

Writes are failing and you need to prove which mounted filesystem is full before deleting or moving anything.

Command

df -h

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not use it to choose a file to delete. `df` tells you the full mount; `du` or `find` tells you what is using space inside it.

Expected output

A filesystem table with Size, Used, Avail, Use%, and Mounted on. Use% tells byte pressure; Mounted on tells the filesystem scope where cleanup must happen.

System impact

Read-only. Nothing changes. The command reports mounted filesystem usage, not individual file or directory size.

Recovery / rollback: no state is changed.

When to use it

Use first in disk triage so cleanup stays inside the filesystem that is actually full.

When not to use it

Do not use it to choose a file to delete. `df` tells you the full mount; `du` or `find` tells you what is using space inside it.

Use% vs Mounted on

Do not clean the path named by the application error until you know which mount is actually full. The Mounted on column is the cleanup boundary.

  1. df -h
  2. du -xhd1 /var 2>/dev/null | sort -h

Common misread

A low Use% on one filesystem does not prove the host has space. Check the specific mount that contains the failing path, then check inodes if bytes look fine.

  1. df -h /var
  2. df -ih /var

next steps

Related commands

Web Server Rescue Can be slow

Find Large Directories with du

Once you know a filesystem is full, the next question is where.

du -xh --max-depth=1 /var 2>/dev/null | sort -h
Web Server Rescue Can be slow

Inspect Release Disk Usage

Disk pressure during deploys often starts in old release directories.

du -sh releases/* 2>/dev/null | sort -h | tail -10

next diagnostic step

Where to go from this command

Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.