Linux Survival Basics
Read-onlyCheck Memory Pressure with free
The machine feels slow or unstable, and you need to tell whether Linux is actually short on usable memory or simply using RAM for cache.
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 panic over a small `free` column by itself. Linux cache is normal; low `available` memory plus swap pressure is the stronger warning.
Expected output
A memory summary showing total, used, free, buff/cache, available, and swap; the `available` and swap lines are usually the first ones to interpret.
System impact
Read-only. Nothing changes. The command displays memory and swap totals from the running system.
Recovery / rollback: no state is changed.
When to use it
Use early in performance triage to check `available` memory, cache, and swap before blaming a specific process.
When not to use it
Do not panic over a small `free` column by itself. Linux cache is normal; low `available` memory plus swap pressure is the stronger warning.
next steps
Related commands
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 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
Find the Processes Eating Memory
Memory pressure can look like a slow app, a stuck deploy, or random crashes.
ps -eo pid,ppid,stat,pcpu,pmem,rss,comm,args --sort=-pmem | head -n 10
Read the Failure Cause in systemctl Status
The status page often tells you the failed startup step before you open every log.
systemctl status app-worker --no-pager --lines=50
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.