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 table of filesystems showing size, used space, available space, use percentage, and mount point. The mount point is the key field for the next command.

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.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        25G   19G  5G  80% /work
tmpfs           982M   12M  970M   2% /run

$ du -xh --max-depth=1 /var 2>/dev/null | sort -h

24M	/var/tmp
180M	/var/cache
1.4G	/var/log
3.8G	/var/lib
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. df -h
  2. du -xh --max-depth=1 /var 2>/dev/null | sort -h

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
Hosting Operations Read-only

Check Bytes and Inodes Before Cleanup

No space left can mean full bytes, full inodes, or both.

df -h /lab/disk-inode-cleanup && df -ih /lab/disk-inode-cleanup
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
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.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:networking
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:system-management
  • risk:read-only

Useful for

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

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