Linux Survival Basics
Read-only, can be slowShow Top Memory Processes
You need a sorted process list by memory use.
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 before identifying owner, service, and workload role.
Expected output
The highest memory processes with PID, command, memory percent, and CPU percent.
System impact
Read-only, can be slow. Nothing changes. The command reads current state and prints diagnostic evidence.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
When to use it
Use during high-memory or OOM triage.
When not to use it
Do not kill a process before identifying owner, service, and workload role.
Example run
Commands shown
These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.
ps -eo pid,comm,%mem,%cpu --sort=-%memps -eo pid,comm,%mem,%cpu --sort=-%mem | head
next steps
Related commands
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 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
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
List Contents of a Backup Tarball
You can inspect an archive without extracting it.
tar -tf archives/site-backup.tar | sort | head
next diagnostic step
Where to go from this command
- High memory process hub Use when one process dominates memory.
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.