process
ps
Snapshots the current process list. Accepts both BSD-style and UNIX-style flags depending on how you want to slice the output.
ps [OPTIONS] Common flags
| Flag | Purpose |
|---|---|
| -e | Select every process |
| -f | Full-format listing (UID, PID, PPID, CMD, etc.) |
| aux | BSD-style: all users, with owner and TTY |
| -o | Custom output columns (e.g. -o pid,rss,cmd) |
| --sort | Sort by one or more columns (prefix - for descending) |
| -p | Show only the given PID(s) |
Examples
ps aux Classic view of every running process
ps -ef | grep nginx Find nginx processes with full command lines
ps -eo pid,rss,cmd --sort=-rss | head Top 10 memory consumers
ps -p 1234 -o etime= Report the elapsed time of a single PID
Gotcha
ps aux (BSD) and ps -ef (UNIX) both work on Linux but produce different columns -- pick the flavor your script parses consistently.
Related commands
top
Interactive real-time view of processes and system resource usage. Refreshes on an interval and supports live sorting and filtering.
kill
Sends a signal to one or more processes. Defaults to SIGTERM, allowing a process to clean up before exiting.
grep
Searches text for lines matching a regular expression. Central to log analysis and pipeline filtering.