Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Process Management with the Linux ps aux Command

List and filter the running processes of your server with ps aux.

How-To Guides2 min read9 screenshots

What ps aux does

ps shows a snapshot of running processes. The letters mean:

  • a shows processes of all users, not only yours.
  • u shows detailed information, including the owner.
  • x includes processes without a controlling terminal, such as services.
ps aux
The ps aux output

The columns

  • USER is the owner of the process.
  • PID is the process ID.
  • %CPU is the share of CPU the process uses.
  • %MEM is the share of RAM it uses.
  • VSZ is the virtual memory size in KB.
  • RSS is the physical memory it uses in KB.
  • TTY is the terminal. ? means there is none.
  • STAT is the state: R running, S sleeping, D waiting for disk, Z zombie (defunct), T stopped. Extra letters like s (session leader), l (multi-threaded) or + (foreground) follow it.
  • START is when it started.
  • TIME is the CPU time used.
  • COMMAND is the command that started it.

Useful variations

Show a process tree:

ps auxf
The process tree view

Show the processes of one user:

ps -u username
Processes of a user

Show one process by ID:

ps -p 2600 -o pid,user,%cpu,%mem,cmd
Showing one process by PID

Sort by CPU use (lowest to highest, add a - for highest first):

ps aux --sort=-%cpu
Sorting the processes by CPU use

Choose your own columns:

ps -eo pid,user,%cpu,cmd
Custom columns

Show the top 5 CPU users:

ps aux --sort=-%cpu | head -n 6
The top CPU processes

(The first line is the header.)

Find zombie processes:

ps aux | grep defunct
Finding defunct processes

Find a process by name or PID:

ps aux | grep 2600
Searching the process list

Tips

  • The command grep also finds itself. Use pgrep name or ps aux | grep [n]ginx to avoid that line.
  • top and htop show the same data live.
  • To stop a process, use kill PID.

Quick recap

  • ps aux lists all processes.
  • Use --sort, -u and -p to narrow the list.