ps
PURPOSE
Reports process status.
SYNOPSIS
ps [ options ]
DESCRIPTION
The ps command writes certain information about active
processes to standard output. Without flags, ps displays
information about the current work station.
The column headings in a ps listing have the following
meaning. The letters f and l following the column heads
indicate which flags cause the corresponding heading to
appear. If all follows the column head, that heading
always appears. Note that the -f and -l flags determine
only what information is provided about a process; they
do not determine which processes are listed.
F (l)
Flags (octal and additive) associated with the
process:
01 In core
02 System process
04 Locked in core (for example, for physical I/O);
10 Waiting for a page default, or forking
20 Being traced by another process
40 Another tracing flag
100 Process has shared text.
S (l)
The state of the process:
0 Nonexistent
S Sleeping
W Waiting
R Running
I Intermediate
Z Canceled
T Stopped
K Available kernel process
X Growing.
UID (f,l)
The user ID of the process owner; the login name is
displayed with the -f flag.
PID (all)
The process ID of the process.
PPID (f,l)
The process ID of the parent process.
C (f,l)
Processor utilization for scheduling.
STIME (f)
Starting time of the process. The NLLDATE and NLTIME
environment variables control the appearance of this
field.
PRI (l)
The priority of the process; higher numbers mean lower
priority.
NI (l)
Nice value; used in calculating priority.
ADDR (l)
The segment number of the process stack, if normal; if
a kernel process, the address of the pre-process data
area.
SZ (l)
The size in blocks of the core image of the process.
WCHAN (l)
The event for which the process is waiting or
sleeping; if blank, the process is running.
TTY (all)
The controlling work station for the process.
TIME (all)
The total execution time for the process.
CMD (all)
The command name; the full command name and its param-
eters are displayed with the -f flag.
A process that has exited and has a parent, but has not
yet been waited for by the parent, is marked <defunct>.
With the -f flag, ps determines what the command name and
parameters were when the process was created by examining
memory or the paging area. If it cannot find this infor-
mation, the command name, as it would appear without the
-f flag, displays in square brackets.
Notes:
1. Things can change while ps is running.
2. Some data displayed for defunct processes are irrel-
evant.
3. The current work station is defined as the one asso-
ciated with standard error. Thus redirecting
standard error, for example:
ps 2> /dev/null
does not work as expected.
FLAGS
-a Writes to standard output information
about all processes except the process
group leaders and processes not associ-
ated with a terminal.
-c corefile Uses corefile instead of the default
/dev/mem. corefile is a core image
file that has been created by the
Ctrl-(left)Alt-End key sequence.
-d Writes information to standard output
about all processes except the process
group leaders.
-e Writes information to standard output
about all processes except kernel proc-
esses.
-f Generates a full listing. The meaning
of columns in a full listing is
described on page .
-g glist Writes information to standard output
only about processes that are in the
process groups listed in glist. The
glist is either a comma-separated list
of process-group identifiers or a list
of process-group identifiers enclosed
in double quotation marks (" ") and
separated from one another by a comma
and/or one or more spaces.
-k Writes information to standard output
about kernel processes. Otherwise, it
does not list kernel processes.
-l Generates a long listing. The meaning
of a long listing is described on page
.
-n kernel-image Takes kernel-image as the name of an
alternate kernel-image file (/unix is
the default).
-p plist Displays only information about proc-
esses with the process numbers speci-
fied in plist. plist is either a
comma-separated list of process-ID
numbers or a list of process-ID numbers
enclosed in double quotation marks
(" ") and separated from one another by
a comma and/or one or more spaces.
-t tlist Displays only information about proc-
esses associated with the work stations
listed in tlist. tlist is either a
list of comma-separated work-station
identifiers or a list of work-station
identifiers enclosed in double quota-
tion marks (" ") and separated from one
another by a comma and/or one or more
spaces.
-u ulist Displays only information about proc-
esses with the user ID numbers or login
names specified in ulist. ulist is
either a comma-separated list of user
ID's or a list of user ID's enclosed in
double quotation marks (" ") and sepa-
rated from one another by a comma
and/or one or more spaces. In the
listing, ps displays the numerical user
ID unless the -f flag is used; then it
displays the login name.
EXAMPLES
1. To list the processes that you have started:
ps
This command displays a summary of information about
the processes associated with your work station.
2. To display all process information available:
ps -e -f -l
This command displays all of the information
("-l -f") about all processes ("-e").
3. To list processes owned by specific users:
ps -f -l -ujim,jane,su
This command displays all the information available
("-l -f") about the processes being run by the users
"jim", "jane", and "su".
4. To list processes associated with specific work
stations:
ps -t-,console
This command displays information about processes not
connected to any work station ("-t-"), and processes
associated with the work station "/dev/console".
FILES
/unix System kernel image.
/dev/mem Memory.
/etc/passwd Supplies UID information.
/etc/ps_data Internal data structure.
/dev Searched to find work station ("TTY")
names.
RELATED INFORMATION
The following commands: "kill" and "nice."