Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ps(1) — SunOS 5.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kill(1)

nice(1)

priocntl(1)

getty(1M)

environ(5)

ps(1)

NAME

ps − report process status

SYNOPSIS

ps [ −acdefjl ] [ −g grplist ] [ −p proclist ] [ −s sidlist ] [ −t term ] [ −u uidlist ]

AVAILABILITY

SUNWcsu

DESCRIPTION

ps prints information about active processes.  Without options, ps prints information about processes associated with the controlling terminal.  The output contains only the process ID, terminal identifier, cumulative execution time, and the command name.  Otherwise, the information that is displayed is controlled by the options. 

Some options accept lists as arguments.  Items in a list can be either separated by commas or else enclosed in double quotes and separated by commas or spaces.  Values for proclist and grplist must be numeric. 

OPTIONS

−a Print information about all processes most frequently requested: all those except process group leaders and processes not associated with a terminal. 

−c Print information in a format that reflects scheduler properties as described in priocntl(1).  The −c option affects the output of the −f and −l options, as described below. 

−d Print information about all processes except session leaders. 

−e Print information about every process now running. 

−f Generate a full listing.  (See below for significance of columns in a full listing.) 

−j Print session ID and process group ID. 

−l Generate a long listing.  (See below.) 

−g grplist List only process data whose group leader’s ID number(s) appears in grplist.  (A group leader is a process whose process ID number is identical to its process group ID number. 

−p proclist List only process data whose process ID numbers are given in proclist. 

−s sidlist List information on all session leaders whose IDs appear in sidlist. 

−t term List only process data associated with term.  Terminal identifiers are specified as a device file name, and an identifier.  For example, term/a, or pts/0. 

−u uidlist List only process data whose user ID number or login name is given in uidlist. In the listing, the numerical user ID will be printed unless you give the −f option, which prints the login name. 

DISPLAY FORMATS

Under the −f option, ps tries to determine the command name and arguments given when the process was created by examining the user block.  Failing this, the command name is printed, as it would have appeared without the −f option, in square brackets. 

The column headings and the meaning of the columns in a ps listing are given below; the letters f and l indicate the option (full or long, respectively) that causes the corresponding heading to appear; all means that the heading always appears.  Note:  These two options determine only what information is provided for a process; they do not determine which processes will be listed. 

F(l) Flags (hexadecimal and additive) associated with the process.  These flags are available for historical purposes; no meaning should be currently ascribed to them. 

S(l) The state of the process:

O Process is running on a processor. 

S Sleeping: process is waiting for an event to complete. 

R Runnable: process is on run queue. 

I Idle: process is being created. 

Z Zombie state: process terminated and parent not waiting. 

T Traced: process stopped by a signal because parent is tracing it. 

X SXBRK state: process is waiting for more primary memory. 

UID(f,l) The user ID number of the process owner (the login name is printed under the −f option). 

PID(all) The process ID of the process (this datum is necessary in order to kill a process). 

PPID(f,l) The process ID of the parent process. 

C(f,l) Processor utilization for scheduling.  Not printed when the −c option is used. 

CLS(f,l) Scheduling class.  Printed only when the −c option is used. 

PRI(l) The priority of the process.  Without the −c option, higher numbers mean lower priority.  With the −c option, higher numbers mean higher priority. 

NI(l) Nice value, used in priority computation.  Not printed when the −c option is used.  Only processes in the time-sharing class have a nice value. 

ADDR(l) The memory address of the process. 

SZ(l) The size (in pages or clicks) of the swappable process’s image in main memory. 

WCHAN (l) The address of an event for which the process is sleeping, or in SXBRK state, (if blank, the process is running). 

STIME(f) The starting time of the process, given in hours, minutes, and seconds.  (A process begun more than twenty-four hours before the ps inquiry is executed is given in months and days.) 

TTY(all) The controlling terminal for the process (the message, ?, is printed when there is no controlling terminal). 

TIME(all) The cumulative execution time for the process. 

COMMAND (all)
The command name (the full command name and its arguments are printed under the −f option). 

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

ENVIRONMENT

If any of the LC_∗ variables ( LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY ) (see environ(5)) are not set in the environment, the operational behavior of ps for each corresponding locale category is determined by the value of the LANG environment variable.  If LC_ALL is set, its contents are used to override both the LANG and the other LC_∗ variables.  If none of the above variables is set in the environment, the "C"  (U.S. style) locale determines how ps behaves. 

LC_CTYPE
Determines how ps handles characters. When LC_CTYPE is set to a valid value, ps can display and handle text and filenames containing valid characters for that locale.  ps can display and handle Extended Unix Code (EUC) characters where any individual character can be 1, 2, or 3 bytes wide.  ps can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid. 

LC_MESSAGES
Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and the correct form of affirmative and negative responses.  In the "C" locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English).

LC_TIME
Determines how ps handles date and time formats.  In the "C" locale, date and time handling follows the U.S.  rules. 

FILES

/dev
/dev/sxt/∗
/dev/tty∗

/dev/xt/∗ terminal (“tty”) names searcher files

/dev/kmem kernel virtual memory

/dev/mem memory

/dev/swap the default swap device

/etc/passwd UID information supplier

/tmp/ps_data internal data structure

SEE ALSO

kill(1), nice(1), priocntl(1), getty(1M), environ(5)

NOTES

Things can change while ps is running; the snap-shot it gives is true only for a split-second, and it may not be accurate by the time you see it.  Some data printed for defunct processes is irrelevant. 

If no termlist, proclist, uidlist, or grplist is specified, ps checks stdin, stdout, and stderr in that order, looking for the controlling terminal and will attempt to report on processes associated with the controlling terminal.  In this situation, if stdin, stdout, and stderr are all redirected, ps will not find a controlling terminal, so there will be no report. 

On a heavily loaded system, ps may report an lseek error and exit.  ps may seek to an invalid user area address: having obtained the address of a process’ user area, ps may not be able to seek to that address before the process exits and the address becomes invalid. 

ps −ef may not report the actual start of a tty login session, but rather an earlier time, when a getty was last respawned on the tty line. 

SunOS 5.4  —  Last change: 27 Jan 1994

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