Back to commands

Linux Survival Basics

Read-only

Take a Memory Pressure Snapshot

You need a current memory snapshot during or after pressure.

Command

free -h

Before you run this

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

When not to use it: Do not treat one snapshot as a trend; compare with process and log evidence.

Expected output

Memory and swap totals, used space, free space, and available memory.

System impact

Read-only. Nothing changes. The command reads current state and prints diagnostic evidence.

Recovery / rollback: no state is changed.

When to use it

Use after OOM logs or high-memory alerts.

When not to use it

Do not treat one snapshot as a trend; compare with process and log evidence.

Example run

Commands shown

These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.

  1. free -h
  2. free -h

next steps

Related commands

Linux Survival Basics Can be slow

Spot OOM Kills in the Kernel Journal

Exit code 137 often means the kernel has something to say.

journalctl -k --since "2 hours ago" --no-pager -o short-iso | grep -Ei 'out of memory|oom|killed process'
Linux Survival Basics Can be slow

Find the Files Eating Your Disk

The disk was full, but guessing at folders was the slow part.

find /var -type f -printf '%s %p\n' | sort -nr | head -20
Linux Survival Basics Can be slow

Find the Processes Using Memory

The server felt slow. Memory pressure was the first thing to rule out.

ps -eo pid,comm,%mem,%cpu --sort=-%mem | head

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

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