Linux Process States

At any moment, every process is in one of a handful of states. Reading these states from ps or top is one of the first things you do when diagnosing a problem.

The Process States

CodeNameMeaning
RRunning/RunnableOn CPU, or ready and waiting for CPU time
SInterruptible SleepWaiting for event (I/O, timer). Can be woken by signals.
DUninterruptible SleepWaiting for I/O. Cannot be killed — not even SIGKILL.
ZZombieFinished, parent hasn't called wait() yet.
TStoppedPaused by SIGSTOP or Ctrl+Z. Resumes with SIGCONT.
IIdle kernel threadSimilar to D but for kernel threads, truly idle

S vs D — The Critical Difference

Both S and D are "sleeping" — but they're very different:

Why can't you kill a process in D state? D (uninterruptible sleep) means the process is in the middle of a critical kernel operation — usually waiting for disk or network I/O at the kernel level. Killing it mid-operation could corrupt data. The kernel ignores SIGKILL in this state. The process will wake up when the I/O completes (or the kernel detects a hang).

Common causes of D state: slow NFS mount, failing disk, kernel bug. If many processes are stuck in D, look for disk issues first:

dmesg | grep -i error iostat -x 1 iotop

Zombie Processes

What is a zombie process and why does it exist? When a process exits, it can't fully disappear yet. The parent might need its exit status (return code). So the kernel keeps a minimal "tombstone" — the process table entry with the exit status. This is the zombie state. Once the parent calls wait(), the zombie is cleaned up.

A few zombies are normal. Thousands of zombies means a parent process is leaking — it's forking children but never calling wait().

# Find zombie processes ps aux | grep Z # Find zombie's parent (to fix the real problem) ps -o ppid= -p ZOMBIE_PID # Then investigate or restart that parent process

State Modifiers in ps Output

ModifierMeaning
sSession leader (controls a terminal)
+In the foreground process group
lMulti-threaded
NLow priority (nice > 0)
<High priority (nice < 0)