irix - ps (1)
NAME
ps - report process status
SYNOPSIS
ps [ options ]
DESCRIPTION
ps prints 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:
-a Print information about all processes most frequently
requested: all those except process group leaders and
processes not associated with a terminal.
-A Print information about every process now running.
-c Print information about the scheduler properties. (See
below.)
-d Print information about all processes except process group
leaders.
-e Print information about every process now running
(equivalent to -A).
-f Generate a full listing. (See below for significance of
columns in a full listing.)
-g grplist List only process data whose process group leader's ID
numbers appear 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.)
-G grplist List only process data whose real group leader's ID numbers
appears in grplist.
-j Print session ID and process group ID.
-l Generate a long listing. (See below.)
-M If the system supports Mandatory Access Control, print the
security label for each process. The -M option can be
automatically be turned on by using an environmental
variable LABELFLAG. Set variable to on (not case sensitive)
for automatic security label information. To turn off
feature set to off or NULL.
-n name This argument is obsolete and is no longer used.
-o format Print information according to the format specification
given in format. (See below.)
-p proclist List only process data whose process ID numbers are given in
proclist.
-s sesslist List information on all session leaders whose IDs appear in
sesslist.
-t termlist List only process data associated with the terminal given in
termlist. Terminal identifiers consist of the device's name
(for example, ttyd1, ttyq1).
-u uidlist List only process data whose user ID number or login name is
given in uidlist. In the listing, the numerical user ID is
printed unless you give the -f option, which prints the
login name.
-U uidlist List only process data whose read user ID number or login
name is given in uidlist.
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 (assuming
the -o option is not specified); all means that the heading always
appears. Note that these options determine only what information is
provided for a process; they do not determine which processes are listed.
If the environment variable _XPG is defined and has a numeric value
greater than 0, ps operates in conformance with the X/Open XPG4
specifications. The format of the output of the -l option differs in
some details from the XPG format and backward compatibility mode. The
differences are explained in the table below.
F (l) Flags (hexadecimal and additive) associated with the
process:
001 Process is a system (resident) process.
002 Process is being traced.
004 Stopped process has been given to parent via
wait(2).
008 Process is sleeping at a non-interruptible priority.
010 Process is in core.
020 Process user area is in core.
040 Process has enabled atomic operator emulation.
080 Process in stream poll or select.
100 Process is a kernel thread.
S (l) The state of the process:
0 Process is running on a processor.
S Process is sleeping, waiting for a resource.
R Process is running.
Z Process is terminated and parent not waiting
(wait(2)).
T Process is stopped.
I Process is in intermediate state of creation.
X Process is waiting for 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.
PGID (j) Process group leader ID. This can be used with the -g
option.
SID (j) Session ID. This can be used with the -s option.
CLS (c) Scheduling class. The values printed for CLS are the two
character mnemonics for the scheduler queues displayed by
the -q option of pset(1M).
C (f,l) Processor utilization for scheduling. Not printed when
the -c option is used.
PRI (l) The priority of the process (higher numbers mean lower
priority).
NI (l) Nice value, used in priority computation. Not printed
when the -c option is used (see nice(1) and csh(1)). Only
Processes in other scheduling classes have their two
letter class mnemonic printed in this field (refer to
schedctl(2) and pset(1M) for information about other
scheduling classes).
P (l) If the process is running, gives the number of processor
on which the process is executing. Contains an asterisk
otherwise. This is not displayed in X/OPEN XPG4
conformance mode.
ADDR (l) The physical address of the process. This is only
displayed in X/OPEN XPG4 conformance mode.
SZ (l) Total size (in pages) of the process, including code,
data, shared memory, mapped files, shared libraries and
stack. Pages associated with mapped devices are not
counted. (Refer to sysconf(1) or sysconf(3C) for
information on determining the page size.)
RSS (l) Total resident size (in pages) of process. This includes
only those pages of the process that are physically
resident in memory. Mapped devices (such as graphics) are
not included. Shared memory (shmget(2)) and the shared
parts of a forked child (code, shared objects, and files
mapped MAP_SHARED) have the number of pages prorated by
the number of processes sharing the page. Two independent
processes that use the same shared objects and/or the same
code each count all valid resident pages as part of their
own resident size. The page size can either be 4096 or
16384 bytes as determined by the return value of the
getpagesize(2) system call. In general the larger page
size is used on systems where uname(1) returns "IRIX64".
This is not displayed in X/OPEN XPG4 conformance mode.
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>.
The -o option allows the output format to be specified under user
control.
The format specification must be a list of names presented as a single
argument, blank- or comma-separated. Each variable has a default header.
The default header can be overridden by appending an equals sign and the
new text of the header. The rest of the characters in the argument are
used as the header text. The fields specified are written in the order
specified on the command line and should be arranged in columns in the
output. The field widths are selected by the system to be at least as
wide as the header text (default or overridden value). If the header
text is null such as -o user=, the field width is at least as wide as the
default header text. If all header text fields are null, no header line
is written.
The following names are recognized:
ruser The real user ID of the process.
user The effective user ID of the process.
rgroup The real group UD of the process.
group The effective group ID of the process.
pid The decimal value of the process ID.
ppid The decimal value of the parent process ID.
pgid The decimal value of the process group ID.
pcpu The ratio of CPU time used recently to the CPU time available in
the same period, expressed as a percentage.
vsz The size of the process in (virtual) memory.
nice The decimal value of the system scheduling priority of the
process.
time The cumulative CPU time of the process.
etime The elapsed time since the process was started.
stime The starting time of the process.
flag Flags associated with the process.
state The state of the process.
wchan The event for which the process is waiting or sleeping.
util Processor utilization for scheduling.
uid The user ID number of the process owner.
cpu The processor process is currently executing on.
class The scheduling class of the process.
tty The name of the controlling terminal of the process (if any) in
the same format used by the who utility.
comm The name of the command being executed (argv[0] value) as a
string.
args The command with all its arguments as a string.
The file /tmp/.ps_data/.ps_data is used to improve the performance of ps
by caching uid to username translations, kernel info, and some device
information. It is recreated when it is older (either the mtime or
ctime) than any of /unix, /dev, or /etc/passwd, or when a read error
occurs on the file. ps runs noticeably slower when this file isn't used,
or needs to be recreated. Note that new NIS users may have jobs reported
automatically; removing this file and rerunning ps fixes the problem.
SHARE II ACTIONS
When the Share II package is installed and enabled, every process
acquires a new property: its attached lnode. The lnode is the kernel
structure that is used to store per-user resource and administration data
under Share II. Many processes can be attached to the same lnode.
An lnode contains a user's resource limits, including limits on memory
usage and `number of processes'. All the processes attached to an lnode
are collectively subject to the lnode's memory and process limits.
Each lnode is addressed by a unique key which is a UID number. When
given the -y option, ps reports each process's lnode attachment under the
`UID' column as a UID or login name.
FILES
/dev
/dev/tty*
/etc/passwd UID information supplier
/tmp/.ps_data/.ps_data
internal data structure
SEE ALSO
getty(1M), gr_osview(1), gr_top(1), kill(1), nice(1), pset(1M),
sysconf(1), top(1), sysconf(3C).
WARNING
Things can change while ps is running; the snapshot it gives is only true
for a splitsecond, 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 attempts to report on processes associated with the
controlling terminal. In this situation, if stdin, stdout, and stderr
are all redirected, ps does not find a controlling terminal, so there is
no report.
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.