Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

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 [ acegklstuvwx# ]

DESCRIPTION

Ps prints information about processes.  Normally, only your processes are candidates to be printed by ps; specifying a causes other users processes to be candidates to be printed; specifying x includes processes without control terminals in the candidate pool. 

All output formats include, for each process, the process id PID, control terminal of the process TT, cpu time used by the process TIME (this includes both user and system time), the state STAT of the process, and an indication of the COMMAND which is running.  The state is given by a sequence of four letters, e.g. “RWNA”.  The first letter indicates the runnability of the process: R for runnable processes, T for stopped processes, D for those in disk (or other short term) waits, S for those sleeping for less than about 20 seconds, and I for idle (sleeping longer than about 20 seconds) processes.  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. 

Here are the options:

a asks for information about all processes with terminals (ordinarily only one’s own processes are displayed). 

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 Asks for the environment to be printed as well as the arguments to the command.  Ignored when selected for c or v formats. 

g Asks for all processes.  Without this option, ps only prints “interesting” processes.  Processes are deemed to be uninteresting if they are process group leaders.  This normally eliminates top-level command interpreters and processes waiting for users to login on free terminals. 

k causes the file /vmcore is used in place of /dev/kmem and /dev/mem.  This is used for postmortem system debugging. 

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

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 A user oriented output is produced.  This includes fields USER, %CPU, %MEM, NICE, SIZE, RSS, and ENG as described below. 

v A version of the output containing virtual memory statistics is output.  This includes fields SL, RE, PAGEIN, SIZE, RSS, LIM, TSIZ, %CPU, %MEM, and ENG described below. 

w Use a wide output format (132 columns if current width is less than that); if repeated, e.g. ww, use arbitrarily wide output.  This information is used to decide how much of long commands to print. 

x asks even about processes with no terminal. 

# 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. 

A second argument is taken to be the file containing the system’s namelist.  Otherwise, /dynix is used.  A third argument tells ps where to look for core if the k option is given, instead of /vmcore.  If a fourth argument is given, it is taken to be the name of a swap file to use instead of the default /dev/drum. 

Fields which are not common to all output formats:

ENGthe processor number on which a runnable process is running (blank if the process is not running)

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% times the number of active processors in the system. 

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) or, if the process is swapped, the resident set size when the process was swapped out. 

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

%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). 

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

SLOAD00001in core
SSYS00002swapper or pager (system) process
STRC00010process is being traced
SWTED00020another tracing flag
SWTOK00040writing on text ok during trace
SOMASK00080restore old mask after taking signal
SVFORK00100process resulted from vfork()
SNOVM00200no vm, parent in a vfork()
STIMO00400timing out during sleep
SOUSIG00800using old signal mechanism
SSEL01000selecting; wakeup/waiting danger
SIGWOKE02000signal woke process up, not v_sema()
SWPSYNC04000synch with swapper during swapout
SFSWAP08000force swap self, swapper couldn’t
SSHMEM10000connected to one or more shared memory’s

A process that has exited and has a parent, but has not yet been waited for by the parent is marked <defunct>; a process which is blocked trying to exit is marked <exiting>; Ps makes an educated guess as to the file name and arguments given when the process was created by examining memory or the swap area.  The method is inherently somewhat unreliable and in any event a process is entitled to destroy this information, so the names cannot be counted on too much. 

FILES

/dynixsystem namelist
/dev/kmem kernel memory
/dev/drumswap device
/vmcorecore file
/devsearched to find swap device and tty names

SEE ALSO

kill(1), w(1)

BUGS

Things can change while ps is running; the picture it gives is only a close approximation to reality. 

4BSD/DYNIX

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