ps Command Cheatsheet
The ps (process status) command displays a snapshot of the currently running processes. It's a fundamental tool for monitoring and troubleshooting.
Common Usage
| Command | Description |
|---|---|
ps | Shows a snapshot of your own processes (in the current terminal). |
ps aux | Displays all running processes on the system in a detailed, user-oriented format.
|
ps -ef | Displays all processes in a full-format listing, which is a common alternative to ps aux.
|
Filtering and Combining
You can combine ps with other commands to filter results and find specific processes.
# Find a specific process by name (e.g., 'nginx')
ps aux | grep nginx
# Find a process by its PID
ps -p [PID]
# View process tree to see parent-child relationships
ps -ef --forest