ps aux States
Luke Hebert
- 2 minutes read - 243 wordsWhen you run ps aux and glance at the STAT column, you see a single letter (or a short string of letters) that tells you what a process is doing right now. Knowing what each code means saves you from guessing whether a process is stuck, sleeping, or actually working.
Standard Process States
The s, stat, and state output specifiers (shown under the header “STAT” or “S”) display the following values:
| Code | Meaning |
|---|---|
| D | Uninterruptible sleep (usually I/O) |
| R | Running or runnable (on run queue) |
| S | Interruptible sleep (waiting for an event to complete) |
| T | Stopped, either by a job control signal or because it is being traced |
| W | Paging (not valid since the 2.6.xx kernel) |
| X | Dead (should never be seen) |
| Z | Defunct (“zombie”) process, terminated but not reaped by its parent |
BSD and stat Keyword Flags
For BSD formats and when the stat keyword is used, additional characters may appear alongside the base state:
| Code | Meaning |
|---|---|
| < | High-priority (not nice to other users) |
| N | Low-priority (nice to other users) |
| L | Has pages locked into memory (for real-time and custom I/O) |
| s | Is a session leader |
| l | Is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) |
| + | Is in the foreground process group |
Note
A process can show multiple characters at once. For example, Ss means the process is in interruptible sleep and is also a session leader. Read the first character as the base state, then interpret the remaining characters as modifiers.