PS (1B)

NAME

ps - (BSD) process status

CONTENTS

Synopsis
Description
Environment Variables
Files
See Also
Notes

SYNOPSIS

/usr/ucb/ps [-aAcglnrSuvwx] [-o property[=[title]], ...] ... [-GptU criteria, ...] ... [pid]

DESCRIPTION

Ps prints certain indicia about active processes. If no options are specified, all processes on the current terminal that are owned by the invoking user and are not session leaders are selected. Specifying -a selects other users' processes; specifying -x selects processes without controlling terminals. The selection can further be changed by adding criteria with the options below; when a process satifies any criterion, it is selected. A criteria string can consist of multiple criteria separated by blanks or commas. If the pid argument is present, output is restriced to the selected process.

By default, ps prints the process id, controlling terminal device, process status, cumulative execution time and command of processes.

The ps command accepts the following options:
-a Selects all processes with a controlling terminal device (including session leaders).
-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.
-g Includes session leaders in the output. Without this option, ps only prints ''interesting'' processes. Processes are deemed to be uninteresting if they are session leaders. This normally eliminates top-level command interpreters and processes waiting for users to login on free terminals.
-l Long listing; adds process flags, numeric user id, parent process id, cpu usage, priority, nice value, memory and resident set size in pages and the event waited for. See below for the meaning of columns.
-n For a user listing as selected with -u, print the numeric user ID instead of the user name.
-r Causes only running processes to be printed.
-S Includes the time used by children that have been waited for.
-t device Selects all processes with the current terminal device. This may be the device name with either /dev/ or /dev/tty omitted, as in ttyS2 or S2 for /dev/ttyS2. Giving ? as a device name selects processes with no controlling terminal.
-u A user oriented output is produced; adds user name, processor usage, memory and resident set size, and the time when the process was started.
-v A version of the output containing virtual memory statistics is output; adds memory and resident set size.
-w Increase output width. The default width of 80 columns is set to 132 if this option is given once; if given more than once, the output width is unlimited.
-x Include processes that have no controlling terminal.
The following options have been introduced by POSIX.2:
-A Selects all processes.
-G gidlist Selects all processes that have one of the specified real group ids, which may be symbolic or numeric.
-o property[=[title]],...
  The output is changed to reflect the named property. Multiple properties can be given, separated by blanks or commas; it is also possible to specify multiple -o options. Normally, the default property description is written in the first output line. If the = character is present, but the title is missing in all format specifications, no descriptions are printed; if a title is given, it is used instead of the default. See below for valid property strings.
-p pidlist Selects all processes with one of the given process ids.
-U uidlist Selects all processes with one of the given real user ids, which may be symbolic or numeric.

The meaning of columns and column headings are as follows:

FFlags associated with the process (octal and additive):
  01in core;
  02system process;
  04locked in core (e.g. for physical I/O);
  10being swapped;
  20being traced by another process.
SThe state of the process:
  Rrunning;
  Ssleeping;
  Iintermediate;
  Zterminated;
  Tstopped;
  Xallocating memory.
UIDThe effective user ID of the process owner.
USERThe name of the process owner, based on the effective user ID.
PIDThe process id of the process; as in certain cults it is possible to kill a process if you know its true name.
PPIDThe process ID of the parent process.
CPProcessor utilization for scheduling.
PRIPriority. High numbers mean low priority.
NINice value, used in priority computation.
ADDRThe core address of the process.
RSSThe amount of memory in pages currently present in core.
SZThe size in pages of the core image of the process.
WCHANThe event for which the process is waiting or sleeping; if blank, the process is running.
STARTThe time when the process was started.            
TTThe controlling tty for the process.
TIMEThe cumulative execution time for the process, including its terminated children if -S is present.
COMMANDThe command line; with the -c option, the command name.

A process that has exited and has a parent, but has not yet been waited for by the parent is marked <defunct>.

For the -o option, the following properties (listed with their default column headings) can be given:

userUSEREffective user name.
ruserRUSERReal user name.
groupGROUPEffective group name.
rgroupRGROUPReal group name.
pidPIDProcess id.
ppidPPIDParent process id.
pgidPGIDProcess group id.
sidSIDSession id.
classCLASSScheduling class.
pcpu%CPUProcessor usage in percent.
vszVSZMemory usage in kilobytes.
niceNINice value.
etimeELAPSEDTime elapsed since the process was started.
timeTIMECumulative execution time.
ttyTTYControlling terminal device.
commCOMMANDThe first command line argument.
argsCOMMANDCommand line arguments separated by spaces.
fFProcess flags.
sSProcess state.
cCProcessor utilization for scheduling.
uidUIDNumeric effective user id.
ruidRUIDNumeric real user id.
gidGIDNumeric effective group id.
rgidRGIDNumeric real group id.
priPRIPriority; high numbers mean high priority.
opriPRIPriority; high numbers mean low priority.
psrPSRProcessor.
addrADDRCore address.
oszSZMemory size in pages.
wchanWCHANEvent for which the process is waiting.
stimeSTIMEStart time of the process.
rssRSSResident set size in kilobytes.
pmem%MEMMemory usage in percent.
fnameCOMMANDThe first 16 characters of the executable file for the process.

For those properties that correspond to user or group names, the numeric id is printed if the name does not fit into the column width.

ENVIRONMENT VARIABLES

COLUMNS
  Overrides the default output width.
LANG, LC_ALL
  See locale(7).
LC_CTYPE
  Determines the set of printable characters and the character width. Non-printable characters in arguments and file names are dropped if writing to a terminal.
LC_TIME
  Affects the format of date and time strings printed.

FILES

/etc/passwd
  Used for converting numeric and symbolic user ids.
/etc/group
  Used for converting numeric and symbolic group ids.
/etc/default/ps
/proc/
/dev/
 

SEE ALSO

nice(1), priocntl(1), kill(1), proc(5), locale(7)

NOTES

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


Heirloom Toolchest PS (1B) 9/5/05
Generated by a modified version of manServer 1.07 from ps.1B using man macros with tbl support.