LinuxCommandLibrary

ps

Report running process status

TLDR

List all processes

$ ps aux
copy
List processes for current user
$ ps -u [username]
copy
Show process tree
$ ps -ef --forest
copy
Show specific process
$ ps -p [pid]
copy
Custom output format
$ ps -eo pid,ppid,cmd,%mem,%cpu
copy
List threads
$ ps -eLf
copy

SYNOPSIS

ps [options]

DESCRIPTION

ps reports a snapshot of currently running processes on the system. It displays information such as process ID, user, CPU and memory usage, command name, and runtime for each process, providing a point-in-time view of system activity.
The command accepts options in two distinct styles: BSD syntax (without dashes, e.g., aux) and POSIX syntax (with dashes, e.g., -ef). Both produce similar output but differ in column defaults and filtering behavior. The -o option allows fully custom output formats, selecting specific fields like pid, ppid, command, and resource usage.
Common usage patterns include ps aux to list all processes with detailed info, ps -ef --forest to show the process hierarchy as a tree, and ps -p to inspect a specific process by PID.

PARAMETERS

a

All users.
u
User-oriented format.
x
Include processes without tty.
-e
Every process.
-f
Full format.
-p PID
Select by PID.
-u USER
Select by user.
--forest
Process tree.
-o FORMAT
Custom output.

CAVEATS

BSD and POSIX options differ. Use aux or -ef.

HISTORY

ps is a classic Unix process monitoring utility.

SEE ALSO

top(1), htop(1), pgrep(1), kill(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community