Linux Survival Basics
Read-onlyCheck Memory Pressure Quickly
A VPS feels slow, and people often restart daemons before checking whether memory pressure is the cause.
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 use it to identify which process is responsible; follow up with ps, top, or systemd-cgtop.
Expected output
A memory table with total, used, free, buff/cache, and available columns.
System impact
Read-only. Nothing changes. free prints total, used, free, shared, buff/cache, and available memory.
Recovery / rollback: no state is changed.
When to use it
Use during slowdowns, deploy validation, memory alerts, or before resizing a VPS.
When not to use it
Do not use it to identify which process is responsible; follow up with ps, top, or systemd-cgtop.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ free -h
total used free shared buff/cache available
Mem: 1.9Gi 1.3Gi 120Mi 12Mi 420Mi 390Mi
Swap: 2.0Gi 128Mi 1.9Gi
$ uptime
14:34:10 up 2 days, 4:18, 1 user, load average: 0.32, 0.58, 0.71
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
free -huptime
next steps
Related commands
Check Memory Pressure with free
Linux memory numbers look scary until you know which column matters.
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'
Check systemd Journal Disk Usage
Before deleting random logs, ask journald how much disk it owns.
journalctl --disk-usage
Check the Installed and Candidate Package Version
apt policy explains where the next version would come from.
apt policy nginx
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
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.
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.