Linux Survival Basics
Read-only, can be slowFind the Processes Using Memory
You need a quick process-level view of memory usage.
Command
ps -eo pid,comm,%mem,%cpu --sort=-%mem | head
Before you run this
System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.
When not to use it: Do not kill a process just because it uses memory; understand its role first.
Expected output
A process table sorted by memory usage.
System impact
Read-only, can be slow. Nothing changes. The command lists processes sorted by memory percentage.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
When to use it
Use this before killing processes or resizing a VPS.
When not to use it
Do not kill a process just because it uses memory; understand its role first.
next steps
Related commands
Find the Processes Burning CPU
A server feels slow, but you need proof before restarting anything.
ps -eo pid,ppid,stat,pcpu,pmem,comm,args --sort=-pcpu | head -n 10
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
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'
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.