Linux Survival Basics
Read-onlyTake 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.
free -hfree -h
next steps
Related commands
Check Memory Pressure with free
Linux memory numbers look scary until you know which column matters.
free -h
Check Memory Pressure Quickly
See whether memory is actually tight before restarting services.
free -h
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'
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
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
- OOM killer logs hub Use after OOM evidence.
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.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.