$linuxjunkies
>

ps(1)

Display information about running processes.

UbuntuDebianFedoraArch

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

FlagWhat it does
aSelect all processes; normally restricts to the current user/session
uDisplay user-oriented format: USER, %CPU, %MEM, STAT, START, TIME, COMMAND
xInclude processes without a controlling terminal (daemons, background jobs)
-eSelect all processes (same as -A); used with -f for full format
-fFull format listing: UID, PID, PPID, C, STIME, TTY, TIME, CMD
-o formatCustom output columns, e.g. -o pid,user,comm,rss (RSS in KB)
-p PIDDisplay information for specific process ID(s); comma-separated list
-u USERFilter by username or UID
--sort fieldSort output by field, e.g. --sort=-%cpu or --sort=-rss (descending)
-HShow process hierarchy (parent-child relationships)
--no-headersOmit the header row from output
-wWide output; truncate long command lines less aggressively

Examples

Show all running processes with user, CPU, memory, and command; most common usage

ps aux

Full format listing of all processes with parent PID and start time

ps -ef

Display info for process with PID 1234 only

ps -p 1234

Show PID, user, command, and memory (RSS) for all processes owned by user alice

ps -u alice -o pid,user,comm,rss

List top 10 processes by memory consumption in descending order

ps aux --sort=-%mem | head -10

Show all processes named 'nginx' (process name filter)

ps -C nginx

Display all processes as a tree showing parent-child relationships

ps -e -H --forest

Find all running Python processes (uses grep to filter output)

ps aux | grep python

Related commands