System administration

Linux ps command

Show a snapshot of processes. This format lists processes for all users.

Availability: Common Linux commands; shell built-ins and external implementations may differ by distribution.中文

Syntax

ps [OPTION]...

Examples

Show processes ordered by memory use.

ps aux --sort=-%mem | head

Show selected fields for process 1234.

ps -p 1234 -o pid,ppid,stat,cmd

Parameters, options and clauses

Option / clauseDescription
-e, -ASelect all processes.
-fUse full-format listing.
-u USERSelect processes for USER and show user-oriented format.
-p PIDLISTSelect processes by process ID.
--sort=KEYSort output by a process field (implementation-specific keys).
aux / -efCommon BSD-style / UNIX-style process listings.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory