ps

Report running process status

TLDR

List all processes
$ ps aux
List processes for current user
$ ps -u [username]
Show process tree
$ ps -ef --forest
Show specific process
$ ps -p [pid]
Custom output format
$ ps -eo pid,ppid,cmd,%mem,%cpu
List threads
$ ps -eLf
Sort by memory usage (descending)
$ ps aux --sort=-%mem
Select processes by command name
$ ps -C [nginx]

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.
-L
Show threads with LWP and NLWP columns.
-C CMD
Select by command name.
--sort KEY
Sort output (e.g., --sort=-%mem).

INSTALL

sudo apt install procps
sudo dnf install procps-ng
sudo pacman -S procps-ng
sudo apk add procps-ng
sudo zypper install procps
brew install procps
nix profile install nixpkgs#procps

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)