Practice Use drills for recall and labs for real operating judgment.

LAB-DISK-01 - Disk Usage (df and du)

Use df and du to understand where disk space is going before deciding what to clean up.

DSK Storage and Disk Management

Disk Usage (df and du)

Use df and du to understand where disk space is going before deciding what to clean up.

20 min BEGINNER LINUX Field-verified
Success criteria
  • Use df to see overall filesystem usage.
  • Use du to identify which directories are taking space.
Safety notes
  • Do not delete files just because they are large. Confirm what they are and whether they are safe to remove.

Part A: The Field Guide

Disk-space problems are easy to mishandle if you jump straight to deleting things.

The safer sequence is:

  1. check which filesystem is full
  2. inspect which directories are large
  3. confirm what the large data actually is
  4. only then decide what action is appropriate

df and du answer different parts of that sequence.

Useful Distinction

df shows filesystem-level usage. du shows how space is distributed across directories or files.


Part B: The Drill Deck

Terminal required: this lab is diagnosis-first.

G
Guided Step by step - type exactly this and compare the result
>

Exercise G1: Check overall filesystem usage

  1. Run df -h
  2. Identify the filesystem with the highest use percentage
  3. Notice the mount point associated with it

Exercise G2: Inspect a directory tree

  1. Run du -sh ~/* 2>/dev/null | sort -h
  2. Notice which directories in your home area are largest
  3. Remember that large does not automatically mean disposable

Exercise G3: Compare the two views

Explain:

  1. what df -h told you
  2. what du -sh told you
  3. why you often need both views together
S
Solo Task described, hints available - figure it out
>

Exercise S1: Narrow the search safely

Pick one larger directory from your home area and run a more focused check such as:

du -sh ~/Downloads/* 2>/dev/null | sort -h

Then decide which entries deserve more investigation, not immediate deletion.

Exercise S2: Explain a safer cleanup mindset

Describe why deleting logs, caches, or old downloads may each require different judgment.

M
Mission Real scenario - no hints, combine multiple skills
>

Mission M1: Build a simple disk-space investigation flow

Write out the sequence you would use when a system reports low disk space:

  1. start with df
  2. narrow with du
  3. confirm what the data is
  4. only then choose a cleanup step

If that sequence feels obvious, the lab has done its job.