Skip to content

ps command

List running processes.

On this page

Syntax

ps [options]

Provided by the procps package. Run man ps for the full manual.

Common options

OptionWhat it does
auxEvery process with user, CPU and memory (BSD style)
-efEvery process, full format
-u USERProcesses of a user
-p PIDOne process
--sort=-%memSort by memory, highest first
-o FIELDSChoose columns
--forestShow the process tree

Examples

  1. All processes

    ps aux
  2. Find a process by name

    ps aux | grep nginx
  3. Top memory users

    ps aux --sort=-%mem | head
  4. Top CPU users

    ps aux --sort=-%cpu | head
  5. Processes of a user

    ps -u www-data
  6. Custom columns

    ps -eo pid,user,%cpu,%mem,cmd --sort=-%cpu | head
  7. Process tree

    ps -ef --forest

← All Linux commands · Suggest a fix

Back to top