Inspecting Processes
Viewing Processes
| Command | Purpose |
|---|---|
ps aux | Snapshot of all processes (BSD style) |
ps -ef | Snapshot (System V style) |
top / htop | Live, interactive view |
pgrep -a nginx | Find PIDs by name |
pstree | Process hierarchy |
uptime | Load averages |
Load average shows demand over 1, 5, 15 minutes. A value roughly equal to your CPU count means fully loaded.
$ ps -ef | head -2
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 09:00 ? 00:00:02 /sbin/init
Exam tip: PID 1 isinit/systemd. Every process has a parent (PPID); orphans are re-parented to PID 1.