1ps(1B) SunOS/BSD Compatibility Package Commands ps(1B)
2
3
4
6 ps - display the status of current processes
7
9 /usr/ucb/ps [-aceglnrSuUvwx] [-t term] [num]
10
11
13 The ps command displays information about processes. Normally, only
14 those processes that are running with your effective user ID and are
15 attached to a controlling terminal (see termio(7I)) are shown. Addi‐
16 tional categories of processes can be added to the display using vari‐
17 ous options. In particular, the -a option allows you to include pro‐
18 cesses that are not owned by you (that do not have your user ID), and
19 the -x option allows you to include processes without controlling ter‐
20 minals. When you specify both -a and -x, you get processes owned by
21 anyone, with or without a controlling terminal. The -r option restricts
22 the list of processes printed to running and runnable processes.
23
24
25 ps displays in tabular form the process ID, under PID; the controlling
26 terminal (if any), under TT; the cpu time used by the process so far,
27 including both user and system time, under TIME; the state of the
28 process, under S; and finally, an indication of the COMMAND that is
29 running.
30
31
32 The state is given by a single letter from the following:
33
34 O Process is running on a processor.
35
36
37 S Sleeping. Process is waiting for an event to complete.
38
39
40 R Runnable. Process is on run queue.
41
42
43 Z Zombie state. Process terminated and parent not waiting.
44
45
46 T Traced. Process stopped by a signal because parent is tracing it.
47
48
50 The following options must all be combined to form the first argument:
51
52 -a Includes information about processes owned by others.
53
54
55 -c Displays the command name rather than the command arguments.
56
57
58 -e Displays the environment as well as the arguments to the
59 command.
60
61
62 -g Displays all processes. Without this option, ps only prints
63 interesting processes. Processes are deemed to be uninter‐
64 esting if they are process group leaders. This normally
65 eliminates top-level command interpreters and processes
66 waiting for users to login on free terminals.
67
68
69 -l Displays a long listing, with fields F, PPID, CP, PRI, NI,
70 SZ, RSS, and WCHAN as described below.
71
72
73 -n Produces numerical output for some fields. In a user list‐
74 ing, the USER field is replaced by a UID field.
75
76
77 -r Restricts output to running and runnable processes.
78
79
80 -S Displays accumulated CPU time used by this process and all
81 of its reaped children.
82
83
84 -t term Lists only process data associated with the terminal, term.
85 Terminal identifiers may be specified in one of two forms:
86 the device's file name (for example, tty04 or term/14 ) or,
87 if the device's file name starts with tty, just the digit
88 identifier (for example, 04).
89
90
91 -u Displays user-oriented output. This includes fields USER,
92 %CPU, %MEM, SZ, RSS, and START as described below.
93
94
95 -U Obsolete. This option no longer has any effect. It causes ps
96 to exit without printing the process listing.
97
98
99 -v Displays a version of the output containing virtual memory.
100 This includes fields SIZE, %CPU, %MEM, and RSS, described
101 below.
102
103
104 -w Uses a wide output format, that is, 132 columns rather than
105 80. If the option letter is repeated, that is, -ww, this
106 option uses arbitrarily wide output. This information is
107 used to decide how much of long commands to print. Note: The
108 wide output option can be viewed only by a superuser or the
109 user who owns the process.
110
111
112 -x Includes processes with no controlling terminal.
113
114
115 num A process number may be given, in which case the output is
116 restricted to that process. This option must be supplied
117 last.
118
119
121 Fields that are not common to all output formats:
122
123 USER Name of the owner of the process.
124
125
126 %CPU CPU use of the process. This is a decaying average over up to
127 a minute of previous (real) time.
128
129
130 NI Process scheduling increment (see getpriority(3C) and
131 nice(3UCB)).
132
133
134 SIZE The total size of the process in virtual memory, including all
135 mapped files and devices, in kilobyte units.
136
137
138 SZ Same as SIZE.
139
140
141 RSS Real memory (resident set) size of the process, in kilobyte
142 units.
143
144
145 UID Numerical user-ID of process owner.
146
147
148 PPID Numerical ID of parent of process.
149
150
151 CP Short-term CPU utilization factor (used in scheduling).
152
153
154 PRI The priority of the process (higher numbers mean lower prior‐
155 ity).
156
157
158 START The starting time of the process, given in hours, minutes, and
159 seconds. A process begun more than 24 hours before the ps
160 inquiry is executed is given in months and days.
161
162
163 WCHAN The address of an event for which the process is sleeping (if
164 blank, the process is running).
165
166
167 %MEM The ratio of the process's resident set size to the physical
168 memory on the machine, expressed as a percentage.
169
170
171 F Flags (hexadecimal and additive) associated with the process.
172 These flags are available for historical purposes; no meaning
173 should be currently ascribed to them.
174
175
176
177 A process that has exited and has a parent, but has not yet been waited
178 for by the parent, is marked <defunct>; otherwise, ps tries to deter‐
179 mine the command name and arguments given when the process was created
180 by examining the user block.
181
183 /dev/tty*
184
185 /etc/passwd UID information supplier
186
187
189 See attributes(5) for descriptions of the following attributes:
190
191
192
193
194 ┌─────────────────────────────┬─────────────────────────────┐
195 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
196 ├─────────────────────────────┼─────────────────────────────┤
197 │Availability │SUNWscpu │
198 └─────────────────────────────┴─────────────────────────────┘
199
201 kill(1), ps(1), whodo(1M), getpriority(3C), nice(3UCB), proc(4),
202 attributes(5), termio(7I)
203
205 Things can change while ps is running. The picture ps gives is only a
206 close approximation to the current state. Some data printed for defunct
207 processes is irrelevant.
208
209
210
211SunOS 5.11 26 May 2006 ps(1B)