PS(1) — Kubota Pacfic Computer Inc. (Essential Utilities)
NAME
ps − report process status
SYNOPSIS
ps [ options ]
DESCRIPTION
ps prints certain information about active processes. Without options, information is printed about processes associated with the controlling terminal. The output consists of a short listing containing only the process ID, terminal identifier, cumulative execution time, and the command name. Otherwise, the information that is displayed is controlled by the selection of options.
Options accept names or lists as arguments. Arguments can be either separated from one another by commas or enclosed in double quotes and separated from one another by commas or spaces. Values for proclist and grplist must be numeric.
The options are given in descending order according to volume and range of information provided:
−e Print information about every process now running.
−d Print information about all processes except process group leaders.
−a Print information about all processes most frequently requested: all those except process group leaders and processes not associated with a terminal.
−f Generate a full listing. (See below for significance of columns in a full listing.)
−l Generate a long listing. (See below.)
−v Generate a memory usage oriented listing. (See below.)
−w Generate a cpu and memory usage oriented listing. (See below.)
−c corefile Use the file corefile in place of /dev/mem.
−n name Take argument signifying an alternate system name in place of /unix.
−t termlist List only process data associated with the terminal given in termlist. Terminal identifiers may be specified in one of two forms: the device’s file name (e.g., tty04) or, if the device’s file name starts with tty, just the digit identifier (e.g., 04).
−p proclist List only process data whose process ID numbers are given in proclist.
−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.
−g grplist List only process data whose process 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. A login shell is a common example of a process group leader.)
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, l, w, and v indicate the option (full, long cpu, or memory respectively) that cause the corresponding heading to appear; all means that the heading always appears. Note that these four 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
00 Process has terminated: process table entry now available.
01 A system process: always in primary memory.
02 Parent is tracing process.
04 Tracing parent’s signal has stopped process: parent is waiting [ptrace(2)].
08 Process cannot be woken by a signal.
10 Process currently in primary memory.
20 Process is locked in memory and cannot be paged out until an event occurs.
40 Parent’s signal goes remote.
100 Process on on run queue
400 Process is doing I/O via /proc.
1000 Process is open via /proc.
2000 Signal mask is restored on return from pause.
4000 Use 4.3 BSD signal semantics.
8000 Process is a 4.3 BSD process group leader.
80000 Process needs to checkpoint the FPU.
S (l,w,v) 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.
L "(l,w,v)" Cpu on which the process last ran.
SZ (l) The size (in pages or clicks) of the swappable process’s image in main memory.
UID (f,l,w) 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.
PRI (l) The priority of the process (higher numbers mean lower priority).
NI (l) Nice value, used in priority computation.
WCHAN (l) The address of an event for which the process is sleeping, or in SXBRK state, (if blank, the process is running or ready to run).
STIME (f,w) 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.
SL (v) Number of seconds the process has been asleep. Will not show times in excess of 99 seconds.
RE (v) Number of seconds the process has been resident in main memory. Will not show times in excess of 99 seconds.
%CPU (v,w) Cpu 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%.
RSS (v,w) Number of kilobytes (1024) of real memory the process is currently using. Does not reflect shared text or data.
SRSS (v,w) Number of kilobytes (1024) of real memory the process is currently using, divided by the number of users of each shared region.
%MEM (v,w) Percentage of real memory in use by this process. Computed by dividing the SRSS figure by the amount of system memory available for user processes.
COMD (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>.
FILES
/dev
/dev/tty∗
/dev/kmem kernel virtual memory
/dev/mem memory
/etc/passwd UID information supplier
/etc/ps_data internal data structure
/unix system namelist
SEE ALSO
WARNING
Things can change while ps is running; the snap-shot it gives is only true 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(2) error and exit. ps may seek to an invalid user area address: having got 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.
September 02, 1992