Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

ps

ps is used for viewing process status

Usage/Output

$ ps
PID        TTY     STAT   TIME          CMD
5140     pts/4    Ss        00:00:00     bash
61244    pts/4    R+        00:00:00     ps
  • PID = the process Id
  • TTY = the terminal device where the process is running
  • STAT = the current status of the process. It can be ‘s’ for sleeping, ‘r’ for running. See the man page ps(1) for more info
  • TIME = the CPU time that the process has used. Note that this is different than the ‘wall-clock’ time
  • CMD = the command used to start the process

Commonly Used Options

There are many options available to the ps command. To make things more confusing, you can specify options in 3 different styles - Unix, BSD, and GNU. Most people use the BSD style, as it is seemingly most comfortable to use (less typing).

Here are some of the most commonly used BSD-style options:

  • ps x = show all of your running processes
  • ps ax = show all processes on the system, not just those that you own
  • ps u = Include more detailed information on processes
  • ps w = show full command names, not just what fits on a single line
  • ps u $$ = status of the current process
  • ps aux = show all processes for all users with verbose detail