Display information about currently running processes.
low risk
ps takes a snapshot of processes. `ps aux` shows all processes for all users (BSD format). Columns include PID, %CPU, %MEM, and COMMAND. Combine with grep to find specific processes. For live views use top or htop.
| Flag | Meaning |
|---|---|
a | Show processes for all users |
u | User-oriented format: show USER, CPU%, MEM% |
x | Include processes without a controlling terminal |
-e | Select all processes (POSIX) |
--sort | Sort output (e.g. --sort=-%cpu for highest CPU first) |
ps aux | grep nginxFind nginx worker processes and their PIDs · explain & risk-check →ps aux --sort=-%mem | head -10Show top 10 memory-consuming processes · explain & risk-check →ps -ef --forestShow all processes as a parent-child tree · explain & risk-check →Use `pgrep -la nginx` instead of `ps aux | grep nginx` — cleaner output that won't include the grep process itself.
Reference text is hand-written and may be incomplete — check man ps for your version. Test destructive commands on a non-production system first.