1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
|
'\" te
.\" Copyright (c) 2002, Sun Microsystems, Inc. - All Rights Reserved.
.\" Copyright (c), 1980 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
.TH PS 1B "May 13, 2017"
.SH NAME
ps \- display the status of current processes
.SH SYNOPSIS
.LP
.nf
\fB/usr/ucb/ps\fR [\fB-aceglnrSuUvwx\fR] [\fB-t\fR \fIterm\fR] [\fInum\fR]
.fi
.SH DESCRIPTION
.LP
The \fBps\fR command displays information about processes. Normally, only those
processes that are running with your effective user \fBID\fR and are attached
to a controlling terminal (see \fBtermio\fR(7I)) are shown. Additional
categories of processes can be added to the display using various options. In
particular, the \fB-a\fR option allows you to include processes that are not
owned by you (that do not have your user \fBID\fR), and the \fB-x\fR option
allows you to include processes without controlling terminals. When you specify
both \fB-a\fR and \fB-x\fR, you get processes owned by anyone, with or without
a controlling terminal. The \fB-r\fR option restricts the list of processes
printed to running and runnable processes.
.sp
.LP
\fBps\fR displays in tabular form the process ID, under \fBPID\fR; the
controlling terminal (if any), under \fBTT\fR; the cpu time used by the process
so far, including both user and system time, under \fBTIME\fR; the state of the
process, under S; and finally, an indication of the \fBCOMMAND\fR that is
running.
.sp
.LP
The state is given by a single letter from the following:
.sp
.ne 2
.na
\fB\fBO\fR\fR
.ad
.RS 5n
Process is running on a processor.
.RE
.sp
.ne 2
.na
\fB\fBS\fR\fR
.ad
.RS 5n
Sleeping. Process is waiting for an event to complete.
.RE
.sp
.ne 2
.na
\fB\fBR\fR\fR
.ad
.RS 5n
Runnable. Process is on run queue.
.RE
.sp
.ne 2
.na
\fB\fBZ\fR\fR
.ad
.RS 5n
Zombie state. Process terminated and parent not waiting.
.RE
.sp
.ne 2
.na
\fB\fBT\fR\fR
.ad
.RS 5n
Traced. Process stopped by a signal because parent is tracing it.
.RE
.SH OPTIONS
.LP
The following options must all be combined to form the first argument:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 11n
Includes information about processes owned by others.
.RE
.sp
.ne 2
.na
\fB\fB-c\fR\fR
.ad
.RS 11n
Displays the command name rather than the command arguments.
.RE
.sp
.ne 2
.na
\fB\fB-e\fR\fR
.ad
.RS 11n
Displays the environment as well as the arguments to the command.
.RE
.sp
.ne 2
.na
\fB\fB-g\fR\fR
.ad
.RS 11n
Displays all processes. Without this option, \fBps\fR 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.
.RE
.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 11n
Displays a long listing, with fields \fBF\fR, \fBPPID\fR, \fBCP\fR, \fBPRI\fR,
\fBNI\fR, \fBSZ\fR, \fBRSS\fR, and \fBWCHAN\fR as described below.
.RE
.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 11n
Produces numerical output for some fields. In a user listing, the \fBUSER\fR
field is replaced by a \fBUID\fR field.
.RE
.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.RS 11n
Restricts output to running and runnable processes.
.RE
.sp
.ne 2
.na
\fB\fB-S\fR\fR
.ad
.RS 11n
Displays accumulated \fBCPU\fR time used by this process and all of its reaped
children.
.RE
.sp
.ne 2
.na
\fB\fB-t\fR \fIterm\fR\fR
.ad
.RS 11n
Lists only process data associated with the terminal, \fIterm\fR. Terminal
identifiers may be specified in one of two forms: the device's file name (for
example, \fBtty04\fR or \fBterm/14\fR ) or, if the device's file name starts
with \fBtty\fR, just the digit identifier (for example, \fB04\fR).
.RE
.sp
.ne 2
.na
\fB\fB-u\fR\fR
.ad
.RS 11n
Displays user-oriented output. This includes fields \fBUSER\fR, \fB%CPU\fR,
\fB%MEM\fR, \fBSZ\fR, \fBRSS\fR, and \fBSTART\fR as described below.
.RE
.sp
.ne 2
.na
\fB\fB-U\fR\fR
.ad
.RS 11n
Obsolete. This option no longer has any effect. It causes \fBps\fR to exit
without printing the process listing.
.RE
.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 11n
Displays a version of the output containing virtual memory. This includes
fields \fBSIZE\fR, \fB%CPU\fR, \fB%MEM\fR, and \fBRSS\fR, described below.
.RE
.sp
.ne 2
.na
\fB\fB-w\fR\fR
.ad
.RS 11n
Uses a wide output format, that is, 132 columns rather than 80. If the option
letter is repeated, that is, \fB-ww\fR, this option uses arbitrarily wide
output. This information is used to decide how much of long commands to print.
\fBNote:\fR The wide output option can be viewed only by a superuser or the
user who owns the process.
.RE
.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.RS 11n
Includes processes with no controlling terminal.
.RE
.sp
.ne 2
.na
\fB\fInum\fR\fR
.ad
.RS 11n
A process number may be given, in which case the output is restricted to that
process. This option must be supplied last.
.RE
.SH DISPLAY FORMATS
.LP
Fields that are not common to all output formats:
.sp
.ne 2
.na
\fB\fBUSER\fR\fR
.ad
.RS 9n
Name of the owner of the process.
.RE
.sp
.ne 2
.na
\fB\fB%CPU\fR\fR
.ad
.RS 9n
\fBCPU\fR use of the process. This is a decaying average over up to a minute of
previous (real) time.
.RE
.sp
.ne 2
.na
\fB\fBNI\fR\fR
.ad
.RS 9n
Process scheduling increment (see \fBgetpriority\fR(3C) and \fBnice\fR(2)).
.RE
.sp
.ne 2
.na
\fB\fBSIZE\fR\fR
.ad
.RS 9n
The total size of the process in virtual memory, including all mapped files and
devices, in kilobyte units.
.RE
.sp
.ne 2
.na
\fB\fBSZ\fR\fR
.ad
.RS 9n
Same as \fBSIZE\fR.
.RE
.sp
.ne 2
.na
\fB\fBRSS\fR\fR
.ad
.RS 9n
Real memory (resident set) size of the process, in kilobyte units.
.RE
.sp
.ne 2
.na
\fB\fBUID\fR\fR
.ad
.RS 9n
Numerical user-ID of process owner.
.RE
.sp
.ne 2
.na
\fB\fBPPID\fR\fR
.ad
.RS 9n
Numerical \fBID\fR of parent of process.
.RE
.sp
.ne 2
.na
\fB\fBCP\fR\fR
.ad
.RS 9n
Short-term \fBCPU\fR utilization factor (used in scheduling).
.RE
.sp
.ne 2
.na
\fB\fBPRI\fR\fR
.ad
.RS 9n
The priority of the process (higher numbers mean lower priority).
.RE
.sp
.ne 2
.na
\fB\fBSTART\fR\fR
.ad
.RS 9n
The starting time of the process, given in hours, minutes, and seconds. A
process begun more than 24 hours before the \fBps\fR inquiry is executed is
given in months and days.
.RE
.sp
.ne 2
.na
\fB\fBWCHAN\fR\fR
.ad
.RS 9n
The address of an event for which the process is sleeping (if blank, the
process is running).
.RE
.sp
.ne 2
.na
\fB\fB%MEM\fR\fR
.ad
.RS 9n
The ratio of the process's resident set size to the physical memory on the
machine, expressed as a percentage.
.RE
.sp
.ne 2
.na
\fB\fBF\fR\fR
.ad
.RS 9n
Flags (hexadecimal and additive) associated with the process. These flags are
available for historical purposes; no meaning should be currently ascribed to
them.
.RE
.sp
.LP
A process that has exited and has a parent, but has not yet been waited for by
the parent, is marked <\fBdefunct\fR>\|; otherwise, \fBps\fR tries to determine
the command name and arguments given when the process was created by examining
the user block.
.SH FILES
.LP
\fB/dev/tty*\fR
.sp
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 15n
\fBUID\fR information supplier
.RE
.SH SEE ALSO
.LP
\fBkill\fR(1), \fBps\fR(1), \fBwhodo\fR(1M), \fBgetpriority\fR(3C),
\fBnice\fR(2), \fBproc\fR(4), \fBattributes\fR(5), \fBtermio\fR(7I)
.SH NOTES
.LP
Things can change while \fBps\fR is running. The picture \fBps\fR gives is only
a close approximation to the current state. Some data printed for defunct
processes is irrelevant.
|