Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kill(1)

w(1)

getrlimit(2)

dump(5)

ps(1)

Name

ps − print process status statistics

Syntax

ps [ options ] [ namelist ] [ corefile ]

Description

The ps command displays information about processes. Information on processes can change while ps is running, so the information it gives is a snapshot taken at a given time.

If you omit the −a option, only your processes are candidates to be displayed by ps. Specifying the −a option causes information about other users’ processes to be displayed; specifying the −x option includes information on processes without control terminals. 

You must use the −k option and specify both the namelist and corefile arguments when you look at a crash dump.  The namelist argument indicates that information is to be gathered using the specified system namelist file.  (The namelist file is a kernel image file).  If you omit namelist, ps uses /vmunix. The core argument indicates that information is to be gathered using the specified core file.  If you omit core, ps uses /dev/mem.

Options

−# Represents any given process number and must be the last option given.  You cannot use this option with the −a and −tx options. 

−C Causes the %CPU field of the display to reflect the absolute percentage of cpu used by the process for scheduling during its resident time . 

−S Causes the TIME field of the display to reflect the amount of user+system time spent by a process and its children. 

−a Displays information for processes executed from all users’ terminals.  The default is to show processes executed from your terminal only.  You cannot use this option with the −# or −t option. 

−c Displays the command names as stored internally in the system for accounting purposes instead of the command arguments, which are kept in the process address space.  This display is more reliable, if less informative, because a process is free to destroy the latter information. 

−e Displays the environment as well as the command arguments. 

−g Displays all processes within the process group.  Without this option, ps displays only “interesting” processes.  Processes that are process group leaders are not considered interesting; therefore, top-level command interpreters and processes waiting for users to log in are normally not shown.

−k Uses the file specified in the core argument in place of /dev/kmem and /dev/mem. If you specify the −k option but no core argument, ps uses /dev/mem.

−l Displays information in long format, showing the fields PPID, CP, PRI, NI, ADDR, SIZE, RSS, and WCHAN as described under Output Fields. 

−s Adds the size SSIZ of the kernel stack of each process to the basic output format for use by system administrators. 

−tx Displays information for only the specified terminal.  This option restricts output to processes whose controlling terminal is x.  Specify x in the same format as ps displays terminal names. For example, ps displays t3 for tty3, tco for console, td0 for ttyd0, t? for processes with no terminal, and t for processes at the current terminal. This option must be the last one given.  You cannot use this option with the −# or −a options. 

−u Displays user-oriented output, which includes fields USER, %CPU, and %MEM. This option also displays SZ and RSS, which are computed differently than they are for the −l and −v options.  The SZ field is computed as SIZE + TSIZ (virtual size plus size of text).  The RRS field is computed as RSS + (TRS/xccount) where xccount is the number of processes currently sharing the text. 

−v Displays process system time and user time in addition to cumulative time.  This display includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU, and %MEM, described under Output Fields. 

−w Produces 132-column rather than 80 column output.  If repeated, as −ww, produces arbitrarily wide output.  This option allows ps to display more of wide displays.

−x Displays information for all processes, including those not executed from terminals. 

Output Fields

The ps command displays the following fields in all output formats:

PIDThe process identification (PID) number

TTThe control terminal of the process

TIMEThe time, including both user and system time

STATThe state of the process given by a sequence of five letters, such as RWNAV. 

The first letter indicates the run status of the process:

RThe process is running. 

TThe process is stopped. 

PThe process is in page wait. 

DThe process is in disk (or other short-term) wait. 

SThe process is sleeping for less than about 20 seconds. 

IThe process is idle (sleeping longer than about 20 seconds). 

The second letter indicates whether a process is swapped out:

WThe process is swapped out. 

ZThe process is killed, but not yet removed. 

(blank)
The process is in core.

>The process has a specified soft limit on memory requirements and is exceeding that limit.  This type of process is not swapped. 

The third letter indicates whether a process is running with an altered CPU scheduling priority, using nice:

NThe process priority is reduced. 

<The process priority has been artificially raised. 

(blank)
The process is running without special treatment.

The fourth letter indicates any special treatment of the process for virtual memory:

ARepresents VA_ANOM.  This status typically represents a lisp process using a disk more efficiently by removing gaps caused by deletes and then collecting the remaining data.

SRepresents VA_SEQL.  This status is typical of large image processing programs that are using virtual memory to sequentially address voluminous data. 

(blank)
Represents VA_NORM.

The fifth letter indicates whether the process is a vector process:

VIndicates that the process is using vector hardware. Only processes running on a VAX processor that contains vector hardware can have this status. 

(blank)
Indicates the process is not using vector hardware.

The following fields are not displayed in all output formats:

USERNames the owner of the process. 

%CPUDescribes the use of the CPU by the process.  This percentage is a decaying average over a minute or less of previous (real) time.  The time base over which this percentage is computed varies because processes may be new.  The sum of all %CPU fields can therefore exceed 200%. 

NICE (or NI)
Indicates the process scheduling increment.  For further information, see getpriority(.).

SIZE (or SZ)
Shows the virtual size of the process in 1024-byte units.

RSSShows the real memory (resident set) size of the process in 1024-byte units. 

LIMIndicates the soft limit on memory used, which is specified by a call to getrlimit(.). If no limit has been specified, this limit is shown as xx

TSIZShows the size of the text (shared program) image. 

TRSShows the size of resident (real memory) set of text. 

%MEMGives the percentage of real memory used by this process. 

REIndicates the residency time of the process (seconds in core). 

SLIndicates the sleep time of the process (seconds blocked). 

PAGEINShows the number of disk input and output operations resulting from references by the process to pages not loaded in core. 

UIDShows the numerical user identification number of the process owner. 

PPIDShows the numerical identification number of the parent of process. 

CPDisplays the short-term CPU use factor used in scheduling. 

PRIDisplays process priority. (This value is nonpositive when the process is in a wait state that cannot be interrupted.) 

ADDRDisplays the swap address of the process or page frame of the beginning of the user page table entries. 

WCHANIndicates the event for which the process is waiting (an address in the system), with the initial part of the address truncated.  For example, the address 80004000 displays as 4000. 

FDisplays flags associated with the process as in <sys/proc.h>:

SLOAD00000001Process is resident in memory.
SSYS00000002System process:  swapper, pager,
idle (RISC only), trusted path daemon.
SLOCK00000004Process is being swapped out.
SSWAP00000008Process requested to swap out for page table
growth.
STRC00000010Traced.
SWTED00000020Used in tracing.
SULOCK00000040Locked in by plock(2).
SPAGE00000080Process is waiting for page-in to complete.
SKEEP00000100Process is protected from swapout while transferring.
resources to another process.
SOMASK00000200Used by sigpause(2).
SWEXIT00000400Process is exiting.
SPHYSIO00000800Process is protected from swapout while doing physical
input or output.
SVFORK00001000Process resulted from a vfork(2) that is not
yet complete.
SVFDONE00002000Parent has received resources returned by
vfork(2) child.
SNOVM00004000Process has no virtual memory, as it is a
parent in the context of vfork(2).
SPAGI00008000Process is demand-paging data pages from its
text gnode.
SSEQL00010000Process has advised of sequential memory access.
SUANOM00020000Process has advised of random memory access.
SXCTDAT00080000Process has indicated intent to execute data
or stack (RISC only).
SNOCLDSTP00100000POSIX environment: no SIGCLD generated when
children stop (formerly named SOUSIG).
SOWEUPC00200000Process is owed a profiling tick.
SSEL00400000Used by select(2).
SLOGIN00800000Process is a login process.
SPTECHG01000000The page table entries for the process have changed.
SLKDONE04000000System V file lock has been applied.
SFIXADE08000000Fix of unaligned accesses is being attempted
(RISC only).
SEXECDN10000000Process has done an execve(2).
SIDLEP20000000The idle process (RISC only).

A process that has a parent and has exited, but for which the parent has not yet waited, is marked <defunct>.  A process that is blocked trying to exit is marked <exiting>. The ps command determines the filename and arguments given when the process was created by examining memory or the swap area.  The method is unreliable because, for example,  a process can destroy this information. The filename and arguments ps displays might be incorrect.

Files

/dev Searched to find swap device and terminal names

/dev/drum Swap device

/dev/kmem Kernel memory

/dev/mem User process information

/vmcore Core file

/vmunix System namelist

See Also

kill(1), w(1), getpriority (2), getrlimit(2), dump(5)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026