Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ps(1) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kill

nice



PS(1,C)                     AIX Commands Reference                      PS(1,C)



-------------------------------------------------------------------------------
ps



PURPOSE

Reports process status.

SYNTAX


      +-- -t console ---+ +--------+ +- -c/dev/kmem -+ +----- -n/unix -----+
ps ---|     one of      |-| +----+ |-|               |-|                   |->
      | +-------------+ | +-| -f |-+ +- -c corfile --+ +- -n kernel-image -+
      +-| -a -g glist |-+  ^| -k ||
        | -e -p plist |    || -l ||
        | -d -t tlist |    || -- ||
        |    -u ulist |    |+----+|
        +-------------+    +------+

      +---------------+   +- /unix ------------------------+
ps ---| +-----------+ |---|                +- /dev/knum -+ |---|
      +-| a k s w  1|-+   +- kernel-image -|             |-+
       ^| c l t x   ||                     +- corefile --+
       || e n o U   ||
       || g r v pid ||
       |+-----------+|
       +-------------+


-----------------
1 No spaces between these options.


DESCRIPTION

The ps command writes certain information about active processes to standard
output.  Without flags, ps displays information about the processes with your
effective user ID.

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.  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:

   00 None apply
   01 In core



Processed November 8, 1990          PS(1,C)                                   1





PS(1,C)                     AIX Commands Reference                      PS(1,C)



   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.  The higher the number, the higher the
   utilization.

STIME  (f)
   Starting time of the process.  The appearance of this field is
   locale-specific.

PRI  (l)
   The priority of the process; higher numbers mean lower priority.

NI  (l)
   Nice value; used in calculating priority.  The default is 20.  The higher
   the number, the lower the priority.

ADDR (l)
   The location of the process's kernel stack.  If in memory, it is the address
   of the u area of the process.  On 386 machines, a pair of addresses are the
   page of the kernel stack followed by the page with the user structure.  If
   swapped out, information of the form bbbb (p) is output, where bbbb is the
   block number on swap partition number p.



Processed November 8, 1990          PS(1,C)                                   2





PS(1,C)                     AIX Commands Reference                      PS(1,C)




SZ  (l)
   The size in 1K blocks of the core image of the process.  This includes the
   stack, data, and text segments.

WCHAN  (l)
   The event for which the process is waiting or sleeping; if blank, the
   process is running.  Numbers refer to addresses in the kernel's address
   space.

TTY  (all)
   The controlling work station for the process.

TIME  (all)
   The total execution time for the process.  The value is specified in minutes
   and seconds.

CMD  (all)
   The command name; the full command name and its parameters are displayed
   with the -f flag.  The command name may not be displayed if it is issued
   from a terminal with a different code page set.

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 information, 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 irrelevant.

  3. To obtain System V-like behavior, precede each option with a hyphen (-).
    To obtain BSD-like behavior, do not precede options with the hyphen.
    (Unknown options are ignored by the BSD-compatible parser.)

  4. Remote child process selection only applies to processes that are
    associated with a terminal.  Child processes on remote sites are only
    selected as long as they continue to be associated with the same terminal.

FLAGS

The - - flag shows processes at your local work station.

In case you do not specify a "-" before your options:  Specifying a causes
other users' processes to be candidates to be printed; specifying x includes
processes without control terminals in the candidate pool.




Processed November 8, 1990          PS(1,C)                                   3





PS(1,C)                     AIX Commands Reference                      PS(1,C)



All output formats include, for each process, the process ID (PID), control
terminal of the process (TT), CPU time used by the process (TIME), (this
includes both user and system time), the state (STAT) of the process, and an
indication of the COMMAND which is running.  The state is given by a sequence
of four letters; the first letter indicates the reliability of the process:  R
for runnable processes, T for stopped processes, P for processes in page wait,
D for those in disk (or other short term) waits, S for those sleeping for less
than about 20 seconds, and I for idle processes (sleeping longer than about 20
seconds.  The second letter indicates whether a process is swapped out, showing
W if it is or a blank if it is loaded (in-core).  A process which has specified
a soft limit on memory requirements and which is exceeding that limit shows >;
such a process is (necessarily) not swapped.  The third letter indicates
whether a process is running with altered CPU scheduling priority (nice).  If
the process priority is reduced, an N is shown.  If the process priority has
been artificially raised, a < is shown.  Processes running without special
treatment just have a blank.  The fourth letter is reserved for future use.

A second argument is taken to be the file containing the system's namelist.
Otherwise, /unix is used.  A third argument tells ps where to look for core if
the k option is given, instead of /core.  If a fourth argument is given, it is
taken to be the name of a paging file to use instead of the default /dev/swap.

Fields which are not common to all output formats:

USER       Name of the owner of the process.

%CPU       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.

NICE       (or NI) process scheduling increment (see setpriority system call in
           the AIX Operating System Technical Reference).

SIZE       Virtual size of the process (in 1024 byte units).

RSS        Real memory (resident set) size of the process (in 1024 byte units).

LIM        Soft limit on memory used, specified via a call to setrlimit.  If no
           limit has been specified, this is shown as xx.  (See setrlimit
           system call in the AIX Operating System Technical Reference.)

TSIZ       Size of text (shared program) image.  This parameter gives size in K
           bytes.

TRS        Size of resident (real memory) set of text.

%MEM       Percentage of real memory used by this process.

RE         Residency time of the process (seconds in core).





Processed November 8, 1990          PS(1,C)                                   4





PS(1,C)                     AIX Commands Reference                      PS(1,C)



SL         Sleep time of the process (seconds blocked).

PAGEIN     Number of disk I/Os resulting from references by the process to
           pages not loaded in core.

UID        Numerical user-ID of process owner.

PPID       Numerical ID of parent of process.

CP         Short-term CPU utilization factor (used in scheduling).

PRI        Process priority (non-positive when in non-interruptible wait).

ADDR       Swap address of the process.

WCHAN      Event on which the process is waiting (an address in the system).  A
           symbol is chosen that classifies the address, unless numerical
           output is requested (see n flag).  In this case, the initial part of
           the address is trimmed off and is printed hexadecimally.  That is,
           0x80004000 prints as 4000.

F          Flags associated with the process as defined in
           /usr/include/sys/proc.h for the p flag values:

           SLOAD    000001  in core
           SSYS     000002  swapper or pager process
           SLOCK    000004  process being swapped out
           SSWAP    000008  save area flag
           STRC     000010  process is being traced
           SWTED    000020  another tracing flag
           SULOCK   000040  user settable lock in core
           SPAGE    000080  process in page wait state
           SKEEP    000100  another flag to prevent swap out
           SDLYU    000200  delayed inlock of pages
           SWEXIT   000400  working on exiting
           SPHYSIO  000800  doing physical I/O (bio.c)
           SVFORK   001000  process resulted from vfork ()
           SVFDONE  002000  another vfork flage
           SNOVM    004000  no vm, parent in vfork()
           SPAGI    008000  init data space on demand from inode
           SANOM    010000  system detected anomalous vm behavior
           SUANOM   020000  user warned of anomalous vm behavior
           STIMO    040000  timing out during sleep
           SDETACH  080000  detached inherited by init
           SOUSIG   100000  using old signal mechanism

A process that has exited and has a parent that has not yet waited for the
process is marked <defunct>; a process which is blocked trying to exit is
marked <exiting>; ps makes an educated guess as to the file name and arguments
given when the process was created by examining memory or the swap area.  The
method is inherently somewhat unreliable and in any event a process is entitled
to destroy this information, so the names cannot be counted on too much.



Processed November 8, 1990          PS(1,C)                                   5





PS(1,C)                     AIX Commands Reference                      PS(1,C)




-a         Writes to standard output information about all processes except the
           process group leaders and processes not associated 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-Pad7 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 processes.

-f         Generates a full listing.  The meaning of columns in a full listing
           is described on page         1.

-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         1.  Size parameter gives stack+data in 4K
           blocks.

-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 processes with the process numbers
           specified 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.

-r         Displays information about children of selected processes that are
           executing on other cluster sites.

-t  tlist  Displays only information about processes 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 quotation marks (" ") and separated from one
           another by a comma and/or one or more spaces.






Processed November 8, 1990          PS(1,C)                                   6





PS(1,C)                     AIX Commands Reference                      PS(1,C)



-u ulist   Displays only information about processes with the user ID numbers
           or login names specified in ulist.  ulist is either a
           comma-separated list of user IDs or a list of user IDs enclosed in
           double quotation marks (" ") and separated 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.

In case you do not specify a "-" before your options.

a    Asks for information about all processes with terminals (ordinarily only
     one's own processes are displayed).

c    Prints the command name, as stored internally in the system for purposes
     of accounting, rather than the command arguments, which are kept in the
     process' address space.  This is more reliable, if less informative, since
     the process is free to destroy the latter information.

e    Asks for the environment to be printed as well as the arguments to the
     command.

g    Asks for all processes.  Without this option, ps only prints "interesting"
     processes.  Processes are deemed to be uninteresting if they are process
     group leaders.  This normally eliminates top-level command interpreters
     and processes waiting for users to login on free terminals.

k    Causes the core image file that has been created by Ctrl-(left) Alt-End
     sequence to be used in place of /dev/kmem.  This is used for postmortem
     system debugging.

l    Asks for a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS
     and WCHAN as described earlier.

n    Asks for numerical output.  In a long listing, the WHCAN field is printed
     numerically rather than symbolically, or, in a user listing, the USER
     field is replaced by a UID filed.

r    Display information for remote children of the processes selected on the
     current site.

s    Adds the size SSIZ of the kernel stack of each process (for use by system
     maintainers) to the basic output format.

t    Restricts output to processes whose controlling tty is x (which should be
     specified as printed by ps; that is t3 for tty3, tconsole for console, tc0
     for ttyc0, t? for processes with no tty, t for processes at the current
     tty, etc.).  This option must be the last one given.

u    A user-oriented output is produced.  This includes fields USER, %CPU,
     NICE, SIZE and RSS.





Processed November 8, 1990          PS(1,C)                                   7





PS(1,C)                     AIX Commands Reference                      PS(1,C)



v    A version of the output containing virtual memory statistics as output.
     This includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, %CPU and %MEM.

w    Use a wide output format (132 columns rather than 80); if repeated, (that
     is, ww), use arbitrarily wide output.  This information is used to decide
     how much of long commands to print.

x    Asks even about process with no terminal.

U    Causes ps to update a private data base where it keeps system information.
     Thus ps U should be included in the /etc/rc file.  Size parameter gives
     stack+data+text in K bytes.

pid  A process number may be given, (indicated here by #), in which case the
     output is restricted to that process.  This option must also be last.

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  -k

    This command displays all of the information ("-l -f") about all processes
    ("-e" and "-k").

  3. To list processes owned by specific users:

      ps  -f  -l  -utom,jane

    This command displays all the information available ("-l -f") about the
    processes being run by the users "tom" and "jane".

  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".

  5. To list the process that you have started:

      ps  u





Processed November 8, 1990          PS(1,C)                                   8





PS(1,C)                     AIX Commands Reference                      PS(1,C)



    This command displays BSD-like user information ("u") about process with
    your UID (default).

  6. To display all process information available:

      ps  lxag

    This command displays a BSD-like long listing ("l") about all processes
    ("xag").

  7. To display a specific process' information:

      ps 1

    This command displays BSD-like summary information for process 1 ("1").

  8. To list processes associated with a specific work station>

      ps vt01

    This command displays BSD-like virtual information ("v") about processes
    associated with tty01 ("to1").

FILES

/machine_name/unix
               System kernel image.
/dev/mem       Memory.
/etc/passwd    Supplies UID information.
/etc/ps_data   Internal data structures.
/dev           Searched to find work station ("TTY") names.

RELATED INFORMATION

See the following commands:  "kill" and "nice."

See setpriority subroutines and setrlimit subroutines in the AIX Operating
System Technical Reference.

















Processed November 8, 1990          PS(1,C)                                   9



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