266

In the STAT column of ps there are a load of letters that don't really make much sense. What do they mean?

Here's an example of ps aux | head:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  27176  2960 ?        Ss   Sep20   0:02 /sbin/init
root         2  0.0  0.0      0     0 ?        S    Sep20   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    Sep20  13:05 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   Sep20   0:00 [kworker/0:0H]
root         7  0.0  0.0      0     0 ?        S<   Sep20   0:00 [kworker/u:0H]
root         8  0.0  0.0      0     0 ?        S    Sep20   2:16 [migration/0]
root         9  0.0  0.0      0     0 ?        S    Sep20   0:00 [rcu_bh]
root        10  0.0  0.0      0     0 ?        S    Sep20  20:08 [rcu_sched]
root        11  0.0  0.0      0     0 ?        S    Sep20   0:07 [watchdog/0]
root        12  0.0  0.0      0     0 ?        S    Sep20   0:05 [watchdog/1]
root        13  0.0  0.0      0     0 ?        S    Sep20   2:21 [ksoftirqd/1]
root        14  0.0  0.0      0     0 ?        S    Sep20   1:00 [migration/1]
Oli
  • 293,335

1 Answers1

439

man ps has all the answers, under the "PROCESS STATE CODES" heading:

PROCESS STATE CODES
       Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to describe the state of a process:
       D    uninterruptible sleep (usually IO)
       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.

       For BSD formats and when the stat keyword is used, additional characters may be displayed:
       <    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 IO)
       s    is a session leader
       l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
       +    is in the foreground process group.
Oli
  • 293,335
  • 51
    I come to this answer quite often as a reference – grasshopper Nov 21 '14 at 22:40
  • 1
    Interestingly I get a "U" as state code which doesn't seem to be documented anywhere. Any idea what that means? – Tom Aug 19 '15 at 13:36
  • 6
    Session leader? – Marco Marsala Oct 20 '15 at 16:02
  • 8
    @MarcoMarsala Where the process's session ID is the same as its process ID. It essentially means that was the first process in the session. It's usually a login terminal like bash, or X. Grouping processes like sessions allows easy cleanup when the leader process ends. It's similar to a parent. – Oli Oct 26 '15 at 09:31
  • 1
    Additional info: < (high priority) is used for any process with a nice value < 0. The lowest nice value is -20, which indicates the highest priority process. N (low priority) is used for any process with a nice value > 0. The highest nice value is 19, which indicates the lowest priority process (nicest process). – VKK Jan 16 '17 at 20:12
  • 7
    @Oli - a new one was added in 2017, I = Idle - https://unix.stackexchange.com/questions/462098/unrecognized-process-state-output-in-ps-command/462102#462102. – slm Aug 12 '18 at 09:26
  • What does SN stands for? – alper Jun 07 '22 at 11:59
  • 1
    @alper Interruptible sleep, and nice (low priority) (thanks @artm) – Oli Jun 07 '22 at 22:22
  • 1
    Interruptible sleep – artm Jun 14 '23 at 08:46