PS(1) | User Commands | PS(1) |
ps - process status
ps [-aAcdefjlLPRy] [-o
property[=[title]], ...] ...
[-gGpstuU criteria, ...] ... [-r
sysname]
Ps prints certain indicia about active processes. If no options are specified, all processes on the current terminal are selected; /usr/5bin/posix/ps and /usr/5bin/posix2001/ps further restrict this to processes owned by the invoking user. The selection can be changed by adding criteria with the options below; when a process satifies any criterion, it is selected. A criteria string can consist of multiple criteria separated by blanks or commas.
By default, ps prints the process id, controlling terminal device, cumulative execution time and command of processes.
The ps command accepts the following options:
The following options have been introduced by POSIX.2:
The following options are extensions:
The meaning of columns and column headings for the -c, -f, -j, -l and -P options are as follows (the letters given in parentheses specify which option causes the column to appear; all means that the column is always printed):
F | (l) | Flags associated with the process (octal and additive): | ||
01 | in core; | |||
02 | system process; | |||
04 | locked in core (e.g. for physical I/O); | |||
10 | being swapped; | |||
20 | being traced by another process. | |||
S | (l) | The state of the process: | ||
O | running on a processor; | |||
R | runnable (on run queue); | |||
S | sleeping; | |||
I | intermediate; | |||
Z | terminated; | |||
T | stopped; | |||
X | allocating memory. | |||
UID | (f,l) | The real user ID of the process owner, or, for /usr/5bin/posix/ps and /usr/5bin/posix2001/ps, the effective user ID. With the -l option, a numeric ID is printed, otherwise the user name. | ||
PID | (all) | The process id of the process; as in certain cults it is possible to kill a process if you know its true name. | ||
PPID | (f,j,l) | The process ID of the parent process. | ||
PGID | (j) | The process group ID of the process. | ||
SID | (j) | The session ID of the process. | ||
LWP | (L) | The lightweight process ID of the process. | ||
NLWP | (fL) | The number of lightweight processes in the process. | ||
PSR | (P) | The processor on which the process is currently running. | ||
C | (f,l) | Processor utilization for scheduling. | ||
CLS | (c) | Scheduling class. | ||
PRI | (c,l) | Priority. With -l, high numbers mean low priority. With -c, high numbers mean high priority; time-sharing processes have priorities below 60; for real-time processes, the priority is computed as 100 + scheduling priority. | ||
NI | (l) | Nice value, used in priority computation. | ||
ADDR | (l) | The core address of the process. | ||
RSS | (ly) | The amount of memory in kilobytes currently present in core. | ||
SZ | (l,R) | The size in pages of the core image of the process. If the -y option is also given, the size is printed in kilobytes. | ||
MRSZ | (R) | The amount of memory in pages currently present in core. | ||
PFLTS | (R) | The number of major page faults that have occurred with the process. | ||
BUFR | (R) | Buffer reads performed on behalf of the process. | ||
BUFW | (R) | Buffer writes performed on behalf of the process. | ||
MRCV | (R) | Messages received by the process. | ||
MSND | (R) | Messages sent by the process. | ||
WCHAN | (l) | The event for which the process is waiting or sleeping; if blank, the process is running. | ||
STIME | (f) | The time when the process was started. | ||
TTY | (all) | The controlling tty for the process. | ||
TIME | (all) | The cumulative execution time for the process. | ||
LTIME | (L) | The cumulative execution time for the lightweight process. | ||
UTIME | (R) | The cumulative time the process spent in user mode. | ||
KTIME | (R) | The cumulative time the process spent in system (kernel) mode. | ||
COMD | (all) | The command name; with the -f option, the command line. The heading `CMD' is printed for /usr/5bin/posix/ps and /usr/5bin/posix2001/ps; the heading `COMMAND' is printed if the SYSV3 environment variable is set and the -l option is not present. |
A process that has exited and has a parent, but has not yet been waited for by the parent is marked <defunct>.
For the -o option, the following properties (listed with their default column headings) can be given:
user | USER | Effective user name. |
ruser | RUSER | Real user name. |
group | GROUP | Effective group name. |
rgroup | RGROUP | Real group name. |
pid | PID | Process id. |
ppid | PPID | Parent process id. |
pgid | PGID | Process group id. |
sid | SID | Session id. |
class | CLASS | Scheduling class. |
pcpu | %CPU | Processor usage in percent. |
vsz | VSZ | Memory usage in kilobytes. |
nice | NI | Nice value. |
etime | ELAPSED | Time elapsed since the process was started. |
time | TIME | Cumulative execution time. |
tty | TTY | Controlling terminal device. |
comm | COMMAND | The first command line argument. |
args | COMMAND | Command line arguments separated by spaces. |
f | F | Process flags. |
s | S | Process state. |
c | C | Processor utilization for scheduling. |
uid | UID | Numeric effective user id. |
ruid | RUID | Numeric real user id. |
gid | GID | Numeric effective group id. |
rgid | RGID | Numeric real group id. |
pri | PRI | Priority; high numbers mean high priority. |
opri | PRI | Priority; high numbers mean low priority. |
psr | PSR | Processor. |
addr | ADDR | Core address. |
osz | SZ | Memory size in pages. |
wchan | WCHAN | Event for which the process is waiting. |
stime | STIME | Start time of the process (may contain whitespace). |
rss | RSS | Resident set size in kilobytes. |
pmem | %MEM | Memory usage in percent. |
fname | COMMAND | The first eight characters of the executable file for the process. |
For those properties that correspond to user or group names, the numeric id is printed if the name does not fit into the column width.
nice(1), kill(1), priocntl(1), proc(5), locale(7)
Things can change while ps is running; the picture it gives is only a close approximation to reality.
8/19/08 | Heirloom Toolchest |