PS (1)

NAME

ps - process status

CONTENTS

Synopsis
Description
Environment Variables
Files
See Also
Notes

SYNOPSIS

ps [-aAcdefjlLPRy] [-o property[=[title]], ...] ... [-gGpstuU criteria, ...] ... [-r sysname]

DESCRIPTION

Ps prints certain indicia about active processes. If no options are specified, all processes on the current terminal are selected; /usr/5bin/posix/ps and /usr/5bin/posix2001/ps further restrict this to processes owned by the invoking user. The selection can 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.

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

The ps command accepts the following options:
-a Selects all processes with a controlling terminal device, except for session leaders.
-c Adds scheduling class and priority to the output. This is the default with /usr/5bin/s42/ps. See below for the meaning of columns.
-d Selects all processes except session leaders.
-e Selects all processes.
-f Full listing; adds user name, parent process id, processor utilization, and the time when the process was started. See below for the meaning of columns.
-g pgrplist For /usr/5bin/ps and /usr/5bin/s42/ps, all processes that belong to one of the process groups ids in pgrplist are selected; for /usr/5bin/posix/ps and /usr/5bin/posix2001/ps, all processes that belong to one of the session ids in group.
-j Adds process group id and session id to the output. See below for the meaning of columns.
-l Long listing; adds process flags, process state, numeric user id, parent process id, processor utilization, priority, nice value, core address, memory size in pages and the event waited for. See below for the meaning of columns.
-p pidlist Selects all processes with one of the given process ids.
-r sysname Change the root directory to sysname, which may be either an absolute pathname or the basename component of a mounted file system. Requires presence of a selection criterion.
-s sidlist Selects all processes that belong to one of the session ids in sidlist.
-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.
-u uidlist Selects all processes with one of the given user ids, which may be symbolic or numeric. The real user id is used with /usr/5bin/ps and /usr/5bin/s42/ps, the effective user id with /usr/5bin/posix/ps and /usr/5bin/posix2001/ps.
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.
-U uidlist Selects all processes with one of the given real user ids, which may be symbolic or numeric.
The following options are extensions:
-L Prints information on lightweight processes (LWPs); adds lightweight process id, lightweight process time, and, if -f is also present, the number of lightweight processes. See below for the meaning of columns.
-P Prints the processor on which the process is currently running. Disables printing of flags and memory address.
-R Resource usage format; prints process id, memory and resident set size, buffer reads and writes, messages sent and received, user and system time, and command. See below for the meaning of columns.
-y Modifies the -l output format; process flags, address and size in pages are omitted, and resident set size and memory size in kilobytes are printed instead.

The meaning of columns and column headings for the -c, -f, -j, -l and -P options are as follows (the letters given in parentheses specify which option causes the column to appear; all means that the column is always printed):

F(l)Flags 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.
S(l)The state of the process:
   Orunning on a processor;
   Rrunnable (on run queue);
   Ssleeping;
   Iintermediate;
   Zterminated;
   Tstopped;
   Xallocating memory.
UID(f,l)The real user ID of the process owner, or, for /usr/5bin/posix/ps and /usr/5bin/posix2001/ps, the effective user ID. With the -l option, a numeric ID is printed, otherwise the user name.
PID(all)The process id of the process; as in certain cults it is possible to kill a process if you know its true name.
PPID(f,j,l)The process ID of the parent process.
PGID(j)The process group ID of the process.
SID(j)The session ID of the process.
LWP(L)The lightweight process ID of the process.
NLWP(fL)The number of lightweight processes in the process.
PSR(P)The processor on which the process is currently running.
C(f,l)Processor utilization for scheduling.
CLS(c)Scheduling class.
PRI(c,l)Priority. With -l, high numbers mean low priority. With -c, high numbers mean high priority; time-sharing processes have priorities below 60; for real-time processes, the priority is computed as 100 + scheduling priority.
NI(l)Nice value, used in priority computation.
ADDR(l)The core address of the process.
RSS(ly)The amount of memory in kilobytes currently present in core.
SZ(l,R)The size in pages of the core image of the process. If the -y option is also given, the size is printed in kilobytes.
MRSZ(R)The amount of memory in pages currently present in core.
PFLTS(R)The number of major page faults that have occurred with the process.
BUFR(R)Buffer reads performed on behalf of the process.
BUFW(R)Buffer writes performed on behalf of the process.
MRCV(R)Messages received by the process.
MSND(R)Messages sent by the process.
WCHAN(l)The event for which the process is waiting or sleeping; if blank, the process is running.
STIME(f)The time when the process was started.     
TTY(all)The controlling tty for the process.
TIME(all)The cumulative execution time for the process.
LTIME(L)The cumulative execution time for the lightweight process.
UTIME(R)The cumulative time the process spent in user mode.
KTIME(R)The cumulative time the process spent in system (kernel) mode.
COMD(all)The command name; with the -f option, the command line. The heading 'CMD' is printed for /usr/5bin/posix/ps and /usr/5bin/posix2001/ps; the heading 'COMMAND' is printed if the SYSV3 environment variable is set and the -l option is not present.

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 (may contain whitespace).
rssRSSResident set size in kilobytes.
pmem%MEMMemory usage in percent.
fnameCOMMANDThe first eight 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

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.
SYSV3 Changes the text of some headings as described above.

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), kill(1), priocntl(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 (1) 10/13/05
Generated by a modified version of manServer 1.07 from ps.1 using man macros with tbl support.