Linux & shell: Processes
6 Linux & shell commands: Processes. Click a command to see what each part does.
Linux & shell: ProcessesIndex
- Whole sheet251
- Navigate & list13
- Create, copy, move, delete13
- View & compare files9
- Permissions & ownership31
- Help & shell basics11
- Users & groups6
- Install packages7
- Package & software versions29
- System info9
- Network basics & SSH10
- Zip & compress4
- Shell operators6
- Processes6
- Files & search8
- Text processing pipelines4
- Disk3
- Network5
- Services & logs6
- Archives & copying4
- Firewall7
- Scheduling: cron & systemd timers6
- Storage, mounts & LVM10
- Kernel, hardware & limits8
- Performance & tracing10
- TLS & certificates8
- Packet capture & network debugging10
- Terminal tools8
Processes6
ps aux | grep <name>Find a process by nameWhat each part does
pssnapshot of current processesauxBSD-style options (no dash): a = all users, u = user-oriented columns (USER, %CPU, %MEM…), x = include processes without a terminal|pipe the process list into grepgrep <name>keep only lines containing <name>
Tip The grep line itself matches too. Use grep "[n]ginx" (brackets on one letter) or pgrep -a <name>.
ps aux --sort=-%mem | headTop 10 processes by memoryWhat each part does
ps auxall processes, user-oriented columns--sort=-%memsort by memory share; the leading "-" means descending| headkeep the first 10 lines (header + top 9)
ps -eo pid,user,%cpu,%mem,comm --sort=-%cpu | head -n 15Custom columns sorted by CPUWhat each part does
-eselect every process-o pid,user,%cpu,%mem,commchoose the output columns: PID, owner, CPU %, memory %, executable name--sort=-%cpuhighest CPU firsthead -n 15first 15 lines
top -b -n 1 | head -n 20One-shot top output (for logs or scripts)What each part does
toplive process viewer-bbatch mode: plain text, no interactive screen (works in pipes)-n 1stop after one refreshhead -n 20summary lines plus the top processes
kill <pid>; sleep 5; kill -9 <pid>Stop a process gracefully, then forcefullyCautionWhat each part does
kill <pid>send SIGTERM (15): asks the process to exit and clean upsleep 5give it time to shut downkill -9 <pid>send SIGKILL: cannot be caught, ends it immediately (no cleanup)
free -hMemory usage in human unitsWhat each part does
freeshow RAM and swap usage-hhuman-readable units (Mi, Gi). Look at the "available" column, not "free"
Nothing matches.
My DevOps Playbook by Angelo John Calleja