Commit | Line | Data |
---|---|---|
dd9e2e8d | 1 | .\" Copyright (c) 1980, 1990 The Regents of the University of California. |
b5dc1377 CL |
2 | .\" All rights reserved. |
3 | .\" | |
4 | .\" %sccs.include.redist.man% | |
5 | .\" | |
0f5eb034 | 6 | .\" @(#)ps.1 6.13 (Berkeley) %G% |
b5dc1377 | 7 | .\" |
b5bb6e20 MT |
8 | .TH PS 1 "March 10, 1988" |
9 | .UC 4 | |
10 | .SH NAME | |
11 | ps \- process status | |
12 | .SH SYNOPSIS | |
fd57c467 KB |
13 | .nf |
14 | .ft B | |
0f5eb034 | 15 | ps [ \-aChjlmrSTuvwx ] [ \-O|o fmt ] [ \-p pid ] [ \-t tty \] [ system ] [ core ] [ swap ] |
fd57c467 KB |
16 | ps [ \-L ] |
17 | .ft R | |
18 | .fi | |
b5bb6e20 | 19 | .SH DESCRIPTION |
fd57c467 KB |
20 | .I Ps |
21 | displays a header line followed by lines containing information about your | |
22 | processes that have controlling terminals. | |
23 | This information is sorted by process ID. | |
b5bb6e20 | 24 | .PP |
fd57c467 KB |
25 | The information displayed is selected based on a set of keywords (see the |
26 | \-L, \-O and \-o options). | |
27 | The default output format includes, for each process, the process' ID, | |
28 | controlling terminal, cpu time (including both user and system time), | |
29 | state, and associated command. | |
b5bb6e20 | 30 | .PP |
fd57c467 | 31 | The options are as follows: |
b5bb6e20 | 32 | .TP |
fd57c467 KB |
33 | \-a |
34 | Display information about other users' processes as well as your own. | |
b5bb6e20 | 35 | .TP |
fd57c467 KB |
36 | \-C |
37 | Change the way the cpu percentage is calculated by using a ``raw'' | |
38 | cpu calculation that ignores ``resident'' time (this normally has | |
39 | no effect). | |
b5bb6e20 | 40 | .TP |
fd57c467 KB |
41 | \-h |
42 | Repeat the information header as often as necessary to guarantee one | |
43 | header per page of information. | |
b5bb6e20 | 44 | .TP |
fd57c467 KB |
45 | \-j |
46 | Print information associated with the following keywords: | |
34fd22d9 | 47 | user, pid, ppid, pgid, sess, jobc, state, tt, time and command. |
b5bb6e20 | 48 | .TP |
fd57c467 KB |
49 | \-L |
50 | List the set of available keywords. | |
51 | If the \-L option is specified more than once, | |
52 | .I ps | |
53 | will display a long listing of the keywords and their meanings. | |
b5bb6e20 | 54 | .TP |
fd57c467 KB |
55 | \-l |
56 | Display information associated with the following keywords: | |
34fd22d9 KB |
57 | uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time |
58 | and command. | |
fd57c467 KB |
59 | .TP |
60 | \-m | |
61 | Sort by memory usage, instead of by process ID. | |
62 | .TP | |
63 | \-O | |
64 | Add the information associated with the space or comma separated list | |
65 | of keywords specifed, after the process ID, in the default information | |
66 | display. | |
67 | Keywords may be appended with an equals (``='') sign and a string. | |
68 | This causes the printed header to use the specified string instead of | |
69 | the standard header. | |
70 | .TP | |
71 | \-o | |
72 | Display information associated with the space or comma separated list | |
73 | of keywords specifed. | |
74 | Keywords may be appended with an equals (``='') sign and a string. | |
75 | This causes the printed header to use the specified string instead of | |
76 | the standard header. | |
77 | .TP | |
78 | \-p | |
79 | Display information associated with the specified process ID. | |
80 | .TP | |
81 | \-r | |
82 | Sort by current cpu usage, instead of by process ID. | |
83 | .TP | |
84 | \-S | |
85 | Change the way the process time is calculated by summing all exited | |
86 | children to their parent process. | |
87 | .TP | |
fd57c467 KB |
88 | \-T |
89 | Display information about processes attached to the device associated | |
90 | with the standard input. | |
91 | .TP | |
92 | \-t | |
93 | Display information about processes attached to the specified terminal | |
94 | device. | |
95 | .TP | |
96 | \-u | |
97 | Display information associated with the following keywords: | |
34fd22d9 | 98 | user, pid, %cpu, %mem, vsz, rss, tt, state, start, time and command. |
fd57c467 KB |
99 | The \-u option implies the \-r option. |
100 | .TP | |
101 | \-v | |
102 | Display information associated with the following keywords: | |
0f5eb034 | 103 | pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, trss, |
34fd22d9 | 104 | %cpu, %mem and command. |
fd57c467 KB |
105 | The \-v option implies the \-m option. |
106 | .TP | |
107 | \-w | |
108 | Use 132 columns to display information, instead of the default which | |
109 | is your window size. | |
110 | If the \-w option is specified more than once, | |
b5bb6e20 | 111 | .I ps |
fd57c467 KB |
112 | will use as many columns as necessary without regard for your window size. |
113 | .TP | |
114 | \-x | |
115 | Display information about processes without controlling terminals. | |
116 | .PP | |
117 | Three additional arguments may be specified. | |
118 | The first additional argument is the file to read for the system namelist | |
119 | (instead of the default ``/vmunix''). | |
120 | The second additional argument is a core file to use for kernel memory | |
121 | (instead of the default ``/dev/mem''). | |
122 | The third addition argument is a file to be used for swap | |
123 | (instead of the default ``/dev/swap''). | |
b5bb6e20 | 124 | .PP |
fd57c467 KB |
125 | A complete list of the available keywords are listed below. |
126 | Some of these keywords are further specifed as follows: | |
b5bb6e20 | 127 | .TP |
e3a8e66d KB |
128 | %cpu |
129 | The cpu utilization of the process; this is a decaying average over up to | |
130 | a minute of previous (real) time. | |
131 | Since the time base over which this is computed varies (since processes may | |
132 | be very young) it is possible for the sum of all %CPU fields to exceed 100%. | |
133 | .TP | |
134 | %mem | |
135 | The percentage of real memory used by this process. | |
136 | .TP | |
fd57c467 KB |
137 | flags |
138 | The flags (in hexadecimal) associated with the process as in | |
139 | the include file ``sys/proc.h'': | |
140 | .sp | |
141 | .nf | |
142 | .RS | |
143 | .ta \w'SNOCLDSTOP 'u +\w'0040000 'u | |
144 | SLOAD 0000001 in core | |
145 | SSYS 0000002 swapper or pager process | |
146 | SLOCK 0000004 process being swapped out | |
147 | SSWAP 0000008 save area flag | |
148 | STRC 0000010 process is being traced | |
149 | SWTED 0000020 another tracing flag | |
150 | SSINTR 0000040 sleep is interruptible | |
151 | SPAGE 0000080 process in page wait state | |
152 | SKEEP 0000100 another flag to prevent swap out | |
153 | SOMASK 0000200 restore old mask after taking signal | |
154 | SWEXIT 0000400 working on exiting | |
155 | SPHYSIO 0000800 doing physical i/o | |
156 | SVFORK 0001000 process resulted from vfork() | |
157 | SVFDONE 0002000 another vfork flag | |
158 | SNOVM 0004000 no vm, parent in a vfork() | |
159 | SPAGV 0008000 init data space on demand, from vnode | |
160 | SSEQL 0010000 user warned of sequential vm behavior | |
161 | SUANOM 0020000 user warned of random vm behavior | |
162 | STIMO 0040000 timing out during sleep | |
163 | SNOCLDSTOP 0080000 no SIGCHLD when children stop | |
164 | SCTTY 0100000 has a controlling terminal | |
165 | SOWEUPC 0200000 owe process an addupc() call at next ast | |
166 | SSEL 0400000 selecting; wakeup/waiting danger | |
167 | SEXEC 0800000 process called exec | |
168 | SHPUX 1000000 HP-UX process (HPUXCOMPAT) | |
169 | SULOCK 2000000 locked in core after swap error | |
170 | SPTECHG 4000000 pte's for process have changed | |
171 | .fi | |
172 | .RE | |
173 | .TP | |
174 | lim | |
175 | The soft limit on memory used, specified via a call to | |
176 | .IR setrlimit (2). | |
177 | .TP | |
178 | lstart | |
e3a8e66d | 179 | The exact time the command started, using the ``%C'' format described in |
fd57c467 KB |
180 | .IR strftime (3). |
181 | .TP | |
182 | nice | |
183 | The process scheduling increment (see | |
184 | .IR setpriority (2)). | |
185 | .TP | |
fd57c467 KB |
186 | rss |
187 | the real memory (resident set) size of the process (in 1024 byte units). | |
188 | .TP | |
189 | start | |
190 | The time the command started. | |
191 | If the command started less than 24 hours ago, the start time is | |
192 | displayed using the ``%l:ps.1p'' format described in | |
193 | .IR strftime (3). | |
194 | If the command started less than 7 days ago, the start time is | |
0f5eb034 | 195 | displayed using the ``%a6.13p'' format. |
fd57c467 | 196 | Otherwise, the start time is displayed using the ``%e%b%y'' format. |
b5bb6e20 MT |
197 | .TP |
198 | state | |
199 | The state is given by a sequence of letters, e.g., ``RWNA''. | |
200 | The first letter indicates the run state of the process: | |
fd57c467 | 201 | .sp |
b5bb6e20 MT |
202 | .PD 0 |
203 | .RS | |
b5bb6e20 | 204 | .IP D |
fd57c467 | 205 | Marks a process in disk (or other short term, uninterruptable) wait. |
b5bb6e20 | 206 | .IP I |
fd57c467 KB |
207 | Marks a process that is idle (sleeping for longer than about 20 seconds). |
208 | .IP P | |
209 | Marks a process in page wait. | |
210 | .IP R | |
211 | Marks a runnable process. | |
212 | .IP S | |
213 | Marks a process that is sleeping for less than about 20 seconds. | |
214 | .IP T | |
215 | Marks a stopped process. | |
b5bb6e20 | 216 | .IP Z |
fd57c467 KB |
217 | Marks a dead process (a ``zombie''). |
218 | .sp | |
219 | .PP | |
220 | Additional characters after these, if any, indicate additional state | |
221 | information: | |
222 | .sp | |
223 | .IP + | |
224 | The process is in the foreground process group of its control terminal. | |
b5bb6e20 | 225 | .IP < |
fd57c467 KB |
226 | The process has raised CPU scheduling priority. |
227 | .IP > | |
228 | The process has specified a soft limit on memory requirements and is | |
229 | currently exceeding that limit; such a process is (necessarily) not | |
230 | swapped. | |
b5bb6e20 | 231 | .IP A |
fd57c467 | 232 | the process has asked for random page replacement (VA_ANOM, from |
b5bb6e20 MT |
233 | .IR vadvise (2), |
234 | e.g., | |
235 | .IR lisp (1) | |
fd57c467 | 236 | in a garbage collect). |
b5bb6e20 | 237 | .IP E |
fd57c467 | 238 | The process is trying to exit. |
b5bb6e20 | 239 | .IP L |
fd57c467 KB |
240 | The process has pages locked in core (e.g., for raw I/O). |
241 | .IP N | |
242 | The process has reduced CPU scheduling priority (see | |
243 | .IR setpriority (2)). | |
244 | .IP S | |
245 | The process has asked for FIFO page replacement (VA_SEQL, from | |
246 | .IR vadvise (2), | |
247 | e.g., a large image processing program using virtual memory to | |
248 | sequentially address voluminous data). | |
b5bb6e20 | 249 | .IP s |
fd57c467 KB |
250 | The process is a session leader. |
251 | .IP V | |
252 | The process is suspended during a vfork. | |
253 | .IP W | |
254 | The process is swapped out. | |
255 | .IP X | |
256 | The process is being traced or debugged. | |
b5bb6e20 MT |
257 | .RE |
258 | .PD | |
259 | .TP | |
e3a8e66d | 260 | tt |
fd57c467 KB |
261 | An abbreviation for the pathname of the controlling terminal, if any. |
262 | The abbreviation consists of the two letters following ``/dev/tty'', | |
263 | or, for the console, ``co''. | |
264 | This is followed by a ``-'' if the process can no longer reach that | |
265 | controlling terminal (i.e., it has been revoked). | |
b5bb6e20 MT |
266 | .TP |
267 | wchan | |
fd57c467 | 268 | The event on which the process is waiting (an address in the system). |
b5bb6e20 | 269 | When printed numerically, the initial part of the address is |
fd57c467 KB |
270 | trimmed off and the result is printed in hex, e.g., 0x80324000 prints |
271 | as 324000. | |
b5bb6e20 | 272 | .PP |
e3a8e66d KB |
273 | When printing using the command keyword, a process that has exited and |
274 | has a parent that has not yet waited for the process (i.e., a zombie) | |
275 | is listed as ``<defunct>'', and a process which is blocked while trying | |
276 | to exit is listed as ``<exiting>''. | |
b5bb6e20 | 277 | .B Ps |
fd57c467 KB |
278 | makes an educated guess as to the file name and arguments given when the |
279 | process was created by examining memory or the swap area. | |
280 | The method is inherently somewhat unreliable and in any event a process | |
281 | is entitled to destroy this information, so the names cannot be depended | |
282 | on too much. | |
e3a8e66d | 283 | The ucomm (accounting) keyword can, however, be depended on. |
fd57c467 | 284 | .SH "KEYWORDS" |
e3a8e66d KB |
285 | The following is a complete list of the available keywords and their |
286 | meanings. | |
287 | Several of them have aliases, i.e. keywords that are synonyms. | |
288 | .sp | |
b5bb6e20 | 289 | .PD 0 |
e3a8e66d KB |
290 | .IP %cpu 10 |
291 | percentage cpu usage (alias pcpu) | |
292 | .IP %mem 10 | |
293 | percentage memory usage (alias pmem) | |
294 | .IP acflag 10 | |
295 | accounting flag (alias acflg) | |
b5bb6e20 MT |
296 | .IP command 10 |
297 | command and arguments | |
fd57c467 KB |
298 | .IP cpu 10 |
299 | short-term cpu usage factor (for scheduling) | |
e3a8e66d KB |
300 | .IP flags 10 |
301 | the process flags, in hexadecimal (alias f) | |
302 | .IP inblk 10 | |
303 | total blocks read (alias inblock) | |
fd57c467 KB |
304 | .IP jobc 10 |
305 | job control count | |
306 | .IP ktrace 10 | |
307 | tracing flags | |
308 | .IP ktracep 10 | |
309 | tracing vnode | |
310 | .IP lim 10 | |
311 | memoryuse limit | |
312 | .IP logname 10 | |
313 | login name of user who started the process | |
fd57c467 KB |
314 | .IP lstart 10 |
315 | time started | |
316 | .IP majflt 10 | |
317 | total page faults | |
318 | .IP minflt 10 | |
319 | total page reclaims | |
320 | .IP msgrcv 10 | |
321 | total messages received (reads from pipes/sockets) | |
322 | .IP msgsnd 10 | |
323 | total messages sent (writes on pipes/sockets) | |
324 | .IP nice 10 | |
e3a8e66d | 325 | nice value (alias ni) |
fd57c467 KB |
326 | .IP nivcsw 10 |
327 | total involuntary context switches | |
e3a8e66d KB |
328 | .IP nsigs 10 |
329 | total signals taken (alias nsignals) | |
fd57c467 KB |
330 | .IP nswap 10 |
331 | total swaps in/out | |
332 | .IP nvcsw 10 | |
333 | total voluntary context switches | |
334 | .IP nwchan 10 | |
e3a8e66d KB |
335 | wait channel (as an address) |
336 | .IP oublk 10 | |
337 | total blocks written (alias oublock) | |
fd57c467 KB |
338 | .IP p_ru 10 |
339 | resource usage (valid only for zombie) | |
340 | .IP paddr 10 | |
341 | swap address | |
342 | .IP pagein 10 | |
343 | pageins (same as majflt) | |
fd57c467 KB |
344 | .IP pgid 10 |
345 | process group number | |
b5bb6e20 MT |
346 | .IP pid 10 |
347 | process ID | |
b5bb6e20 MT |
348 | .IP poip 10 |
349 | pageouts in progress | |
fd57c467 KB |
350 | .IP ppid 10 |
351 | parent process ID | |
352 | .IP pri 10 | |
353 | scheduling priority | |
354 | .IP re 10 | |
355 | core residency time (in seconds; 127 = infinity) | |
356 | .IP rgid 10 | |
357 | real group ID | |
b5bb6e20 MT |
358 | .IP rlink 10 |
359 | reverse link on run queue, or 0 | |
fd57c467 KB |
360 | .IP rss 10 |
361 | resident set size | |
e3a8e66d KB |
362 | .IP rsz 10 |
363 | resident set size + (text size / text use count) (alias rssize) | |
fd57c467 KB |
364 | .IP ruid 10 |
365 | real user ID | |
b5bb6e20 MT |
366 | .IP ruser 10 |
367 | user name (from ruid) | |
b5bb6e20 MT |
368 | .IP sess 10 |
369 | session pointer | |
fd57c467 | 370 | .IP sig 10 |
e3a8e66d | 371 | pending signals (alias pending) |
fd57c467 | 372 | .IP sigcatch 10 |
e3a8e66d | 373 | caught signals (alias caught) |
fd57c467 | 374 | .IP sigignore 10 |
e3a8e66d | 375 | ignored signals (alias ignored) |
fd57c467 | 376 | .IP sigmask 10 |
e3a8e66d | 377 | blocked signals (alias blocked) |
fd57c467 KB |
378 | .IP sl 10 |
379 | sleep time (in seconds; 127 = infinity) | |
380 | .IP start 10 | |
381 | time started | |
382 | .IP state 10 | |
e3a8e66d | 383 | symbolic process state (alias stat) |
fd57c467 KB |
384 | .IP svgid 10 |
385 | saved gid from a setgid executable | |
386 | .IP svuid 10 | |
387 | saved uid from a setuid executable | |
b5bb6e20 MT |
388 | .IP tdev 10 |
389 | control terminal device number | |
e3a8e66d KB |
390 | .IP time 10 |
391 | accumulated cpu time, user + system (alias cputime) | |
b5bb6e20 MT |
392 | .IP tpgid 10 |
393 | control terminal process group ID | |
0f5eb034 | 394 | .IP trss 10 |
fd57c467 | 395 | text resident set size (in Kbytes) |
e3a8e66d | 396 | .IP tsess 10 |
b5bb6e20 | 397 | control terminal session pointer |
fd57c467 KB |
398 | .IP tsiz 10 |
399 | text size (in Kbytes) | |
e3a8e66d KB |
400 | .IP tt 10 |
401 | control terminal name (two letter abbreviation) | |
402 | .IP tty 10 | |
403 | full name of control terminal | |
404 | .IP uprocp 10 | |
fd57c467 KB |
405 | process pointer |
406 | .IP ucomm 10 | |
407 | name to be used for accounting | |
408 | .IP uid 10 | |
409 | effective user ID | |
e3a8e66d KB |
410 | .IP upr 10 |
411 | scheduling priority on return from system call (alias usrpri) | |
fd57c467 KB |
412 | .IP user 10 |
413 | user name (from uid) | |
e3a8e66d KB |
414 | .IP vsz 10 |
415 | virtual size in Kbytes (alias vsize) | |
fd57c467 | 416 | .IP wchan 10 |
e3a8e66d | 417 | wait channel (as a symbolic name) |
fd57c467 KB |
418 | .IP xstat 10 |
419 | exit or stop status (valid only for stopped or zombie process) | |
b5bb6e20 MT |
420 | .PD |
421 | .SH FILES | |
fd57c467 KB |
422 | .ta \w'/var/run/kvm_vmunix.db 'u |
423 | /dev special files and device names | |
424 | .br | |
425 | /dev/drum default swap device | |
b5bb6e20 | 426 | .br |
fd57c467 | 427 | /dev/kmem default kernel memory |
b5bb6e20 | 428 | .br |
fd57c467 | 429 | /var/run/dev.db /dev name database |
b5bb6e20 | 430 | .br |
fd57c467 | 431 | /var/run/kvm_vmunix.db system namelist database |
b5bb6e20 | 432 | .br |
fd57c467 | 433 | /vmunix default system namelist |
b5bb6e20 | 434 | .SH "SEE ALSO" |
fd57c467 | 435 | kill(1), w(1), kvm(3), strftime(3), pstat(8) |
b5bb6e20 MT |
436 | .SH BUGS |
437 | Things can change while | |
438 | .I ps | |
fd57c467 | 439 | is running; the picture it gives is only a fairly close |
b5bb6e20 | 440 | approximation to reality. |