Ps: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 34: Line 34:
==-l==
==-l==


Displays the [[Linux_General_Concepts#Process_States|process state]] ([[#S|S]]) and, if sleeping, what kernel channel it is waiting on ([[#WCHAN|WCHAN]]).
Displays the [[Linux_General_Concepts#Process_States|process state]] ([[#S|S]]) and, if [[Linux_General_Concepts#Interruptible_Sleep_.28S.29|sleeping]], what kernel channel it is waiting on ([[#WCHAN|WCHAN]]).


=Columns=
=Columns=
Line 54: Line 54:
==WCHAN==
==WCHAN==


If the process is sleeping, shows the kernel channel the process is waiting on.
If the process is [[Linux_General_Concepts#Interruptible_Sleep_.28S.29|sleeping]], shows the kernel channel the process is waiting on.

Revision as of 00:22, 3 May 2018

Internal

Overview

ps gets its information from /proc/<pid>/stat files.

Options

-A, -e

Select all processes. -A and -e are identical.

-f

Full-format listing.

-L

Show threads.

The thread ID is listed under the "LWP" column.

--forest

Hierarchical display of the process tree.

--no-headers

Skips the display of the header line. Useful when counting lines in the ps output with wc -l.

-l

Displays the process state (S) and, if sleeping, what kernel channel it is waiting on (WCHAN).

Columns

PID

LWP

The thread ID.

NLWP

The number of threads for the process.

S

The process state.

WCHAN

If the process is sleeping, shows the kernel channel the process is waiting on.