Learn to snapshot processes with ps and inspect live activity with top to find and fix resource hogs. 15.11.2025 | reading time: 3 min Want to know which program is chewing CPU or memory right now? Use `ps` to take a precise snapshot and `top` to watch activity live; this short guide shows commands you can run immediately and how to interpret their output. Spot a runaway process A web service appears slow; capture a snapshot and a quick live report to identify the offender: ```bash $ ps aux --sort=-%mem | head -n 6 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND www-data 3124 12.3 25.4 123456 260000 ? Ssl 10:12 120:34 /usr/bin/python app.py root 1021 5.0 10.1 98765 104000 ? Ss 09:00 20:10 /usr/sbin/daemon syslog 2048 0.5 1.2 40000 10000 ? Ss 09:30 1:05 /usr/bin/rsyslogd $ top -b -n1 | head -n 12 top - 10:15:01 up 1 day, 2:13, 2 users, load average: 0.75, 0.60, 0.55 Tasks: 200 total, 1 running, 199 sleeping, 0 stopped, 0 zombie %Cpu(s): 12.3 us, 3.1 sy, 0.0 ni, 84.6 id, 0.0 wa Mem: 8192M total, 6200M used, 1992M free PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3124 www-data 20 0 1234560 260000 12000 S 12.3 25.4 120:34 python ``` Read the numbers Learn the key columns: PID identifies the process, %CPU and %MEM show resource share, VSZ and RSS give virtual and resident sizes, STAT shows state; in `top` press `M` to sort by memory, `P` by CPU, `k` to kill and `r` to renice while watching live, so you act immediately when you spot trouble. Find processes quickly Filter and format `ps` for automation: use `ps aux` or `ps -ef` for full snapshots, `ps -C processname -o pid,pcpu,pmem,cmd` to target a binary, and capture a scripted snapshot with `top -b -n1` for logging; combine `ps` with `grep` or `pgrep -a` to locate the exact command line and owner. Where to go next For sustained monitoring prefer non-interactive output for logs, and consider batch tools when collecting historical data; practice reading `ps` and `top` until the columns and interactive keys feel natural, because quick diagnoses save hours in production. Final step Mastering `ps` and `top` is a foundational skill for troubleshooting Linux systems; keep practicing, explore advanced monitoring tools, and consider formalizing skills with CompTIA Linux+ or LPIC-1 training—bitsandbytes.academy offers intensive exam preparation to get you there. Join Bits & Bytes Academy First class LINUX exam preparation. processes utilities troubleshooting