0% found this document useful (0 votes)
6 views

Process State

Uploaded by

John Mith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Process State

Uploaded by

John Mith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

%Number : Use the job number such as %1 or %2.

%String : Use the string whose name begins


with suspended command such as %commandNameHere or
%ping.
%+ OR %% : Refers to the current job.
%- : Refers to the previous job.

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 by job control signal
t stopped by debugger during the tracing
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

What is a session in Linux?

Session usually refers to shell sessions. A shell is what allows you


to interact with the computer. It acts as a bridge between the user
and the kernel. Whenever you run a command, it is the shell that
captures your intent and tells the kernel to do its thing.
A session is a collection of process groups, which are either attached
to a single terminal device (known as the controlling terminal) or not
attached to any terminal

#ps -> Command having three options

1 UNIX options, which may be grouped and must be preceded by a


dash.
2 BSD options, which may be grouped and must not be used with
a dash.
3 GNU long options, which are preceded by two dashes.

ps -p $(pidof httpd) -> to find out along with httpd how many process
associate
ps –p <pid> -o etime -> to find out process, how long it’s running

You might also like