ps
Report a snapshot of current processes
Overview
Displays information about a selection of the active processes running on the system. It can show process IDs, user, CPU/memory usage, command name, etc.
Syntax
ps [OPTION]...Common Options
a(All with tty) List all processes with a TTY, except session leaders.
u(User-oriented format) Display user-oriented format (USER, PID, %CPU, %MEM, VSZ, RSS, TTY, STAT, START, TIME, COMMAND).
x(Processes without controlling ttys) List processes without a controlling TTY (often daemons).
e, -e, -A(All processes) Select all processes on the system.
-f, --fullDo full-format listing. Often used with -e (e.g., ps -ef).
-l, l(Long format) Display long format, providing more detail.
--forestDisplay processes in a hierarchical "forest" or "tree" view, showing parent-child relationships.
auxCommon combination: a (all with tty), u (user-oriented), x (processes without controlling tty).
-C command_nameSelect by command name.
-u userlist, --user userlistSelect by effective user ID (EUID) or name.
-p pidlist, --pid pidlistSelect by process ID (PID).
--sort specifiersSpecify sorting order (e.g., ps aux --sort=-%cpu to sort by CPU usage descending).
Examples
Show all processes on the system in user-oriented format.
Show all processes in full format (another common way to see everything).
Show processes owned by username.
Show information for process ID 12345.
Show processes sorted by memory usage (descending) and display the top few.
Show all processes in a tree-like format.
Show processes named nginx.