ps(1)
NAME
ps − print process status statistics
SYNTAX
ps [options] [namelist] [core]
DESCRIPTION
The ps command prints information about processes. Without the −a option, only your processes are candidates to be printed by ps. Specifying the −a option causes other user’s processes to be printed and specifying the −x option includes processes without control terminals.
The optional namelist argument indicates that information is to be gathered using the specified system namelist file. If not specified, use /vmunix. The core argument indicates that information is to be gathered using the specified corefile. If not specified, uses /dev/mem.
OPTIONS
−#Represents any given process number and must be the last option given. When used together with a or tx, this option overrides the a option, but the tx option overrides this one.
−aDisplays information for processes executed from all user terminals. Default is for processes executed from your terminal only.
−cDisplays command names which are stored internally in the system for accounting purposes 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.
−eDisplays the environment as well as the command arguments.
−gDisplays 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.
−kUses file /vmcore in place of /dev/kmem and /dev/mem. If k option is used, but no corefile is specified, uses /vmcore.
−lDisplays information in long format. Displays a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS, and WCHAN as described under OUTPUT FIELDS.
−sAdds the size SSIZ of the kernel stack of each process to the basic output format for use by system maintainers.
−txDisplays information for specified terminal only. Restricts output to processes whose controlling tty is x. The argument x should be specified as printed by ps. For example, t3 for tty3, tco for console, td0 for ttyd0, t? for processes with no tty, t for processes at the current tty, and so forth, are proper specifications for x. This option must be the last one given.
−uDisplays user-oriented output, which includes fields USER, %CPU, and %MEM, SIZE. It also displays SZ and RSS which are computed differently than for the −l and −v options. The SZ field is computed as SIZE + TSIZ (virtual size plus size of text). The TRS field is computed as RSS + (TRS/xccount) where xccount is the number of processes currently sharing the text.
−vDisplays process system time and user time in addition to cumulative time. This includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU and %MEM, described under OUTPUT FIELDS.
−wProduces 132-column rather than 80 column output. If repeated, as ww, use arbitrarily wide output. This information is used to decide how much to print for long commands.
−xDisplays information for all processes, including those not executed from terminals.
OUTPUT FIELDS
All output formats include, for each process:
PIDthe process identification (PID) number
TTcontrol terminal of the process
TIMEIncludes both user and system time
STATthe state of the process, given by a sequence of four letters, for example, RWNA.
The first letter indicates the run status of the process:
RRunning processes
TStopped processes
PProcesses in page wait
DProcesses in disk (or other short-term) waits
SProcesses sleeping for less than about 20 seconds
IIdle processes (sleeping longer than about 20 seconds)
The second letter indicates whether a process is swapped out:
WProcesses which are swapped out
(blank)
Processes which are in core
>for processes which have specified a soft limit on memory requirements and which are exceeding that limit. Such a process is not swapped.
The third letter indicates whether a process is running with altered CPU scheduling priority, using nice(.).
NThe process priority is reduced
<The process priority has been artificially raised
(blank)
Processes running without special treatment
The fourth letter indicates any special treatment of the process for virtual memory. The possibilities are:
AStands for VA_ANOM. Typically represents a lisp() making disk usage more efficient by removing gaps caused by deletes and collecting the remaining data.
SStands for VA_SEQL. Typical of large image processing programs that are using virtual memory to sequentially address voluminous data.
(blank)
Stands for VA_NORM.
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 a minute or less 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 200%.
NICE(or NI) process scheduling increment. For further information, see setpriority(.).
SIZE(or SZ) virtual size of the process (in 2024-byte units)
RSSreal memory (resident set) size of the process (in 2024-byte units)
LIMsoft limit on memory used, specified via a call to getrlimit(.). 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 operations resulting from references by the process to pages not loaded in core
UIDnumerical user identification number of process owner
PPIDnumerical identification number of parent of process
CPshort-term CPU utilization factor used in scheduling
PRIprocess priority (nonpositive when in noninterruptible wait)
ADDRswap address of the process or page frame of the beginning of the user page table entries
WCHANevent on which process is waiting (an address in the system), with the initial part of the address trimmed off. For example, 80004000 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
STRC000020process is being traced
SWTED000020another tracing flag
SULOCK000040user settable lock in core
SPAGE000080process in page wait state
SKEEP000200another flag to prevent swap out
SDLYU000200delayed unlock of pages
SWEXIT000400working on exiting
SPHYSIO000800doing physical i/o (bio.c)
SVFORK002000process resulted from vfork()
SVFDONE002000another vfork flag
SNOVM004000 no vm, parent in a vfork()
SPAGI008000 init data space on demand from inode
SANOM020000 system detected irregular vm behavior
SUANOM020000 user warned of irregular vm behavior
STIMO040000 timing out during sleep
SDETACH080000 detached inherited by init
SOUSIG200000 using old signal mechanism
SOWEUPC200000 owe process an addupc() call at next ast
SSEL400000 selecting; wakeup/waiting danger
SLOGIN800000 a login process (legit child of init)
SPTECHG2000000 pte’s for process have changed
SMASTER2000000 need service by master processor
A process that has a parent and has exited, but for which the parent has not yet waited is marked <defunct>. A process which is blocked trying to exit is marked <exiting>; The ps command 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.
RESTRICTIONS
Information on processes can change while ps is running. The picture it gives is a snapshot taken at a given time.
FILES
/vmunixSystem namelist
/dev/kmemKernel memory
/dev/memUser process info
/dev/drumSwap device
/vmcoreCore file
/devSearched to find swap device and tty names