A fast, practical cheat sheet for process inspection and troubleshooting. Designed for rapid recall.
Mental Model
ps shows running processes from the kernel’s process table.
BSD style
Unix style
Both styles are useful in different contexts. BSD style is typically more human-readable, while Unix style provides more detailed process hierarchy information.
Most Common Commands
Show all processes (human-friendly)
Show all processes (Unix format)
-e= everything-f= full format (UID, PPID, CMD, args)
Filtering Processes
Search for a process by name
Search for a process by name
Using ps built-in pattern match (GNU)
Using ps built-in pattern match (GNU)
Show processes for a user
Show processes for a user
Filter by PID
Filter by PID
Useful Columns (What They Mean)
| Column | Meaning |
|---|---|
| PID | Process ID |
| PPID | Parent process ID |
| UID | User owning the process |
| %CPU | CPU usage percentage |
| %MEM | Memory usage percentage |
| VSZ | Virtual memory size (KB) |
| RSS | Resident memory (physical RAM in KB) |
| STAT | Process state |
| TIME | CPU time consumed |
| COMMAND | Command executed |
Process State Codes (STAT)
R
Running
S
Sleeping (waiting for event)
D
Uninterruptible sleep (usually I/O)
T
Stopped (by signal)
Z
Zombie (terminated but not reaped)
+
Foreground process group
Formatting Output
Custom columns
Custom columns
Sorted by memory
Sorted by memory
- prefix for descending order).Sorted by CPU
Sorted by CPU
Tree view (relationships)
Tree view (relationships)
Practical Troubleshooting Examples
Highest CPU consumers
Highest memory consumers
Find processes holding deleted files
Processes holding open file handles to deleted files can cause disk space issues. Use
lsof for more detailed investigation.Show environment variables for a PID
Minimal Recall Table
| Concept | Shortcut | |
|---|---|---|
| All processes | ps aux or ps -ef | |
| Filter by name | `ps aux | grep name` |
| Custom columns | ps -eo ... | |
| Sort by CPU | --sort=-%cpu | |
| Sort by memory | --sort=-%mem | |
| Tree view | --forest |
When to Use ps vs. Other Tools
| Goal | Use |
|---|---|
| Live, updating view | top, htop |
| Deep inspection | /proc/<pid>/ |
| Check file handles | lsof |
| Check open sockets | ss |
| Full system monitoring | atop, glances |
ps provides a snapshot at a point in time. For continuous monitoring, use top, htop, or atop instead.