ps(1)
Display information about running processes.
Synopsis
ps [OPTION]...Description
The ps command reports a snapshot of currently running processes on the system. Each row represents one process; by default it shows only processes in the current session.
Without options, ps displays the process ID (PID), terminal (TTY), CPU time, and command name. Use various flags to filter, sort, or display additional process information like memory usage, user, and process state.
Most users rely on a few common flag combinations: ps aux for all running processes, ps -ef for a full-format listing, or ps -p PID to inspect a specific process.
Common options
| Flag | What it does |
|---|---|
a | Select all processes; normally restricts to the current user/session |
u | Display user-oriented format: USER, %CPU, %MEM, STAT, START, TIME, COMMAND |
x | Include processes without a controlling terminal (daemons, background jobs) |
-e | Select all processes (same as -A); used with -f for full format |
-f | Full format listing: UID, PID, PPID, C, STIME, TTY, TIME, CMD |
-o format | Custom output columns, e.g. -o pid,user,comm,rss (RSS in KB) |
-p PID | Display information for specific process ID(s); comma-separated list |
-u USER | Filter by username or UID |
--sort field | Sort output by field, e.g. --sort=-%cpu or --sort=-rss (descending) |
-H | Show process hierarchy (parent-child relationships) |
--no-headers | Omit the header row from output |
-w | Wide output; truncate long command lines less aggressively |
Examples
Show all running processes with user, CPU, memory, and command; most common usage
ps auxFull format listing of all processes with parent PID and start time
ps -efDisplay info for process with PID 1234 only
ps -p 1234Show PID, user, command, and memory (RSS) for all processes owned by user alice
ps -u alice -o pid,user,comm,rssList top 10 processes by memory consumption in descending order
ps aux --sort=-%mem | head -10Show all processes named 'nginx' (process name filter)
ps -C nginxDisplay all processes as a tree showing parent-child relationships
ps -e -H --forestFind all running Python processes (uses grep to filter output)
ps aux | grep python