Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ps(1) — Duplix 4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kill(1)

w(1)

PS(1)  —  Unix Programmer’s Manual

NAME

ps − process status

SYNOPSIS

ps [ options ]

DESCRIPTION

Ps prints information about processes.  Normally, ps prints only your own processes.  With the −a option, ps prints other users’ processes.  With the −x option, it includes information about processes without control terminals. 

All output formats include the following for each process:

PIDthe process id
TTcontrol terminal of the process
TIMEcpu time used by the process (includes both user and system time)
STATthe state of the process
COMMANDan indication of the command which is running.

Ps identifies the state of a process by a sequence of four letters, e.g. “RWNA”.  The first letter indicates the runnability of the process:

Rrunnable processes
Tstopped processes
Pprocesses in page wait
Dthose in disk (or other short term) waits
Sthose sleeping for less than about 20 seconds
Iidle (sleeping longer than about 20 seconds)

The second letter indicates whether a process is swapped out, showing W if it is, or a blank if it is loaded (in-core); a process which has specified a soft limit on memory requirements and which is exceeding that limit shows >; such a process is (necessarily) not swapped. 

The third letter indicates whether a process is running with altered CPU scheduling priority (nice); if the process priority is reduced, an N is shown, if the process priority has been artificially raised then a ‘<’ is shown; processes running without special treatment have just a blank. 

The final letter indicates any special treatment of the process for virtual memory replacement; the letters correspond to options to the vadvise(2) call.  Currently the possibilities are as follows:

AVA_ANOM
SVA_SEQL
blankVA_NORM

An A typically represents a lisp(1) in garbage collection, S is typical of large image processing programs which are using virtual memory to sequentially address voluminous data. 

OPTIONS

−a Requests information about all processes with terminals (ordinarily ps displays only the user’s own processes). 

−c Prints the command name as stored internally in the system for purposes of accounting rather than the command arguments, which are kept in the process’ address space.  This is more reliable, if less informative, since the process is free to destroy the latter information. 

−e Prints the environment as well as the arguments to the command. 

−g Tells ps to list information about all processes.  Without this option, ps prints information about “interesting” processes only.  Ps coniders process group leaders to be uninteresting processes.  Thus, ps normally excludes top-level command interpreters and processes waiting for users to login on free terminals. 

−k Tells ps to use the file /vmcore in place of /dev/kmem and /dev/mem.  Use this option for postmortem system debugging. 

−l Requests a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS and WCHAN as described below. 

−n Asks for numerical output.  In a long listing, the WCHAN field is printed numerically rather than symbolically, or, in a user listing, the USER field is replaced by a UID field. 

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

−tx Restricts output to processes whose controlling tty is x (which should be specified as printed by ps, e.g.  t3 for tty3, tco for console, td0 for ttyd0, t?  for processes with no tty, t for processes at the current tty, etc).  This option must be the last one given. 

−u Produces user-oriented output.  This includes fields USER, %CPU, NICE, SIZE, and RSS as described below. 

−v Prints a version of the output containing virtual memory statistics.  This includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU and %MEM, described below. 

−w Uses a wide output format (132 columns rather than 80); if repeated, e.g. ww, uses arbitrarily wide output.  Ps uses this information to decide how much of long commands to print. 

−x Requests information about processes with no terminal. 

−U Causes ps to update a private database in which system information is kept.  Thus “ps U” should be included in the /etc/rc file. 

# A process number may be given, (indicated here by #), in which case the output is restricted to that process.  This option must also be last. 

Ps considers a second argument to be the file containing the system’s namelist.  Otherwise, ps uses /vmunix.  A third argument tells ps where to look for core if the k option is given, instead of /vmcore.  If you specify a fourth argument, ps interprets it as the name of a swap file to use instead of the default /dev/drum. 

Fields which are not common to all output formats:

USERname of the owner of the process

%CPUcpu utilization of the process; this is a decaying average over up to a minute of previous (real) time.  Since the time base over which this is computed varies (since processes may be very young), it is possible for the sum of all %CPU fields to exceed 100%. 

NICE(or NI) process scheduling increment (see setpriority(2))

SIZEvirtual size of the process (in 1024 byte units)

RSSreal memory (resident set) size of the process (in 1024 byte units)

LIMsoft limit on memory used, specified via a call to setrlimit(2); if no limit has been specified then shown as xx

TSIZsize of text (shared program) image

TRSsize of resident (real memory) set of text

%MEMpercentage of real memory used by this process. 

REresidency time of the process (seconds in core)

SLsleep time of the process (seconds blocked)

PAGEINnumber of disk i/o’s resulting from references by the process to pages not loaded in core. 

UIDnumerical user-id of process owner

PPIDnumerical id of parent of process

CPshort-term cpu utilization factor (used in scheduling)

PRIprocess priority (non-positive when in non-interruptible wait)

ADDRswap address of the process

WCHANevent on which process is waiting (an address in the system).  A symbol is chosen that classifies the address, unless numerical output is requested (see the n flag).  In this case, ps trims off the initial part of the address and prints it hexadecimally, e.g., 0x80004000 prints as 4000. 

Fflags associated with process as in <sys/proc.h>:

SLOAD000001in core
SSYS000002swapper or pager process
SLOCK000004process being swapped out
SSWAP000008save area flag
STRC000010process is being traced
SWTED000020another tracing flag
SULOCK000040user settable lock in core
SPAGE000080process in page wait state
SKEEP000100another flag to prevent swap out
SDLYU000200delayed unlock of pages
SWEXIT000400working on exiting
SPHYSIO000800doing physical i/o (bio.c)
SVFORK001000process resulted from vfork()
SVFDONE002000another vfork flag
SNOVM004000no vm, parent in a vfork()
SPAGI008000init data space on demand from inode
SANOM010000system detected anomalous vm behavior
SUANOM020000user warned of anomalous vm behavior
STIMO040000timing out during sleep
SDETACH080000detached inherited by init
SOUSIG100000using old signal mechanism

A process that has exited and has a parent that has not yet waited for the process is marked <defunct>.  A process which is blocked trying to exit is marked <exiting>.  Ps makes an educated guess about the filename and arguments given when the process was created by examining memory or the swap area.  The method is inherently unreliable.  Furthermore, a process can to destroy this information, so the names cannot be counted on too much. 

FILES

/vmunixsystem namelist
/dev/kmemkernel memory
/dev/drumswap device
/vmcorecore file
/devsearched to find swap device and tty names
/etc/psdatabasesystem namelist, device, and wait channel information

SEE ALSO

kill(1), w(1)

BUGS

That status of process can change while ps is running.  Ps, then, provides only an approximation of the process status. 
 

4th Berkeley Distribution  —  May 12, 1986

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