ps(1) ps(1)
NAME
ps - report process status
SYNOPSIS
ps [-e] [-d] [-a] [-f] [-l] [-ccorefile] [-sswapdev]
[-nnamelist] [-ttermlist] [-pproclist] [-uuidlist]
[-ggrplist]
DESCRIPTION
ps prints certain information about active processes.
Without flag options, information is printed about processes
associated with the current 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 flag options.
Flag options using lists as arguments may have the list
specified in one of two forms: a list of identifiers
separated from one another by a comma, or a list of
identifiers enclosed in double quotes and separated from one
another by a comma and/or one or more spaces.
The flag options are:
-e Print information about all processes.
-d Print information about all processes, except
process group leaders.
-a Print information about all processes, except
process group leaders and processes not
associated with a terminal.
-f Generate a full listing. (See below for
meaning of columns in a full listing).
-l Generate a long listing. See below.
-ccorefile Use the file corefile in place of /dev/mem.
-sswapdev Use the file swapdev in place of /dev/swap.
This is useful when examining a corefile; a
swapdev of /dev/null will cause the user block
to be zeroed out.
-nnamelist The argument will be taken as the name of an
alternate namelist file in place of /unix.
-ttermlist Restrict listing to data about the processes
associated with the terminals given in
termlist. The termlist may be in one of two
forms: a list of terminal identifiers separated
from one another by a comma, or a list of
terminal identifiers enclosed in double quotes
and separated from one another by a command
and/or one or more spaces. Terminal
identifiers may be specified in one of two
forms: the device's filename (e.g., tty04), or,
if the device's filename starts with tty, just
Page 1 (last mod. 1/16/87)
ps(1) ps(1)
the digit identifier (e.g., 04).
-pproclist Restrict listing to data about processes whose
process ID numbers are given in proclist.
-uuidlist Restrict listing to data about processes whose
user ID numbers or login names are given in
uidlist. In the listing, the numerical user ID
will be printed unless the -f flag option is
used, in which case the login name will be
printed.
-ggrplist Restrict listing to data about processes whose
process group leaders are given in grplist.
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 that these two flag options determine
only what information is provided for a process; they do not
determine which processes will be listed.
F (l) Flags (hex and additive) associated with the
process:
0 swapped;
1 system process;
2 being traced by another process;
4 another tracing flag;
8 process cannot be woken by a
signal;
10 in core;
20 locked in memory;
100 process group leader;
200 faulting in page
400 COFF binary
1000 process is using select system call
2000 timing out during sleep
4000 4.2-style job control
8000 restore old mask after signal
S (l) The state of the process:
- non-existent;
S sleeping;
R running;
I intermediate (between states);
Z terminated;
T stopped.
O as running on CPU
X waiting for virtual memory
UID (f,l) The user ID number of the process owner; the
login name is printed under the -f flag
option.
PID (all) The process ID of the process; it is possible
to kill a process if you know this datum.
Page 2 (last mod. 1/16/87)
ps(1) ps(1)
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.
ADDR (l) The memory address of the u-area (a pointer to
the page tables) of the process, if resident;
otherwise, the disk address.
SZ (l) The size in logical pages 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.
STIME (f) Starting time of the process.
TTY (all) The controlling terminal for the process.
TIME (all) The cumulative execution time for the process.
CMD (all) The command name; the full command name and
its arguments are printed under the -f flag
option.
A process that has exited and has a parent, but has not yet
been waited for by the parent, is marked defunct.
Under the -f flag option, ps tries to determine the command
name and arguments given when the process was created by
examining memory or the swap area. Failing this, the
command name, as it would appear without the -f flag option,
is printed in square brackets.
EXAMPLE
ps -ef
displays information about all processes, with or without
terminals.
FILES
/bin/ps
/unix system namelist
/dev/mem memory
/dev/swap the default swap device
/etc/passwd supplies UID information
/etc/psdata internal data structure
/dev searched to find terminal (tty) names
SEE ALSO
acctcom(1), kill(1), nice(1).
BUGS
Things can change while ps is running; the picture it gives
is only a close approximation to reality. Some data printed
for defunct processes are irrelevant.
Processes which are swapped onto other than the default swap
Page 3 (last mod. 1/16/87)
ps(1) ps(1)
device (see swap(1M) will have some invalid information
printed out.
Page 4 (last mod. 1/16/87)