Commit | Line | Data |
---|---|---|
24115aa8 KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
3e284fd6 | 5 | .\" @(#)ps.1 6.4 (Berkeley) %G% |
24115aa8 | 6 | .\" |
9a22b5c6 | 7 | .TH PS 1 "" |
24115aa8 KM |
8 | .UC 4 |
9 | .SH NAME | |
10 | ps \- process status | |
11 | .SH SYNOPSIS | |
12 | .B ps | |
13 | [ | |
53829504 | 14 | .B acegklnstuvwxU# |
24115aa8 KM |
15 | ] |
16 | .SH DESCRIPTION | |
17 | .I Ps | |
18 | prints information about processes. | |
19 | Normally, only your processes are candidates to be printed by | |
20 | .I ps; | |
21 | specifying | |
22 | .B a | |
c3f41f75 | 23 | causes other users' processes to be candidates to be printed; |
24115aa8 KM |
24 | specifying |
25 | .B x | |
26 | includes processes without control terminals in the candidate pool. | |
27 | .PP | |
28 | All output formats include, for each process, the process id PID, | |
29 | control terminal of the process TT, cpu time used by the process TIME | |
30 | (this includes both user and system time), the state STAT of the process, | |
31 | and an indication of the COMMAND which is running. | |
32 | The state is given by a sequence of four letters, e.g. ``RWNA''. | |
33 | The first letter indicates the runnability of the process: | |
34 | R for runnable processes, | |
35 | T for stopped processes, | |
36 | P for processes in page wait, | |
37 | D for those in disk (or other short term) waits, | |
38 | S for those sleeping for less than about 20 seconds, | |
39 | and I for idle (sleeping longer than about 20 seconds) | |
40 | processes. | |
41 | The second letter indicates whether a process is swapped out, | |
42 | showing W if it is, or a blank if it is loaded (in-core); | |
43 | a process which has specified a soft limit on memory requirements | |
44 | and which is exceeding that limit shows >; such a process is (necessarily) | |
45 | not swapped. | |
46 | The third letter indicates whether a process is running with altered | |
dee48434 KM |
47 | CPU scheduling priority (nice); if the process priority is reduced, |
48 | an N is shown, if the process priority has been artificially raised then | |
49 | a `<' is shown; processes running without special treatment have just a | |
24115aa8 KM |
50 | blank. |
51 | The final letter indicates any special treatment of the process for virtual | |
52 | memory replacement; the letters correspond to options to the | |
53 | .IR vadvise (2) | |
54 | call; currently the possibilities are A standing for VA_ANOM, | |
55 | S for VA_SEQL and blank for VA_NORM; an A typically represents a | |
56 | .IR lisp (1) | |
57 | in garbage collection, S is typical of large image processing programs | |
58 | which are using virtual memory to sequentially address voluminous data. | |
59 | .PP | |
60 | Here are the options: | |
61 | .TP 5 | |
62 | .B a | |
63 | asks for information about all processes with terminals (ordinarily | |
64 | only one's own processes are displayed). | |
65 | .TP 5 | |
66 | .B c | |
67 | prints the command name, as stored internally in the system for purposes | |
68 | of accounting, rather than the command arguments, which are kept | |
69 | in the process' address space. This is more reliable, if less informative, | |
70 | since the process is free to destroy the latter information. | |
71 | .TP 5 | |
72 | .B e | |
73 | Asks for the environment to be printed as well as the arguments to the command. | |
74 | .TP 5 | |
75 | .B g | |
76 | Asks for all processes. | |
77 | Without this option, | |
78 | .I ps | |
79 | only prints ``interesting'' processes. | |
80 | Processes are deemed to be uninteresting if they are process group leaders. | |
81 | This normally eliminates top-level command interpreters and processes | |
82 | waiting for users to login on free terminals. | |
83 | .TP 5 | |
84 | .B k | |
85 | causes the file | |
86 | .I /vmcore | |
87 | is used in place of | |
88 | .IR /dev/kmem " and " /dev/mem. | |
89 | This is used for | |
90 | postmortem system debugging. | |
91 | .TP 5 | |
92 | .B l | |
93 | asks for a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS and | |
94 | WCHAN as described below. | |
95 | .TP 5 | |
53829504 KM |
96 | .B n |
97 | Asks for numerical output. | |
98 | In a long listing, the WCHAN field is printed numerically rather than | |
99 | symbolically, or, in a user listing, the USER field is replaced by a | |
100 | UID field. | |
101 | .TP 5 | |
24115aa8 KM |
102 | .B s |
103 | Adds the size SSIZ of the kernel stack of each process (for use by system | |
104 | maintainers) to the basic output format. | |
105 | .TP 5 | |
106 | \fBt\fIx\fR | |
107 | restricts output to processes whose controlling tty is \fIx\fR | |
108 | (which should be specified as printed by | |
109 | .I ps, | |
110 | e.g. | |
111 | .I t3 | |
112 | for tty3, | |
113 | .I tco | |
114 | for console, | |
115 | .I td0 | |
116 | for ttyd0, | |
117 | .I t? | |
118 | for processes with no tty, | |
dee48434 KM |
119 | .I t |
120 | for processes at the current tty, | |
24115aa8 KM |
121 | etc). |
122 | This option must be the last one given. | |
123 | .TP 5 | |
124 | .B u | |
125 | A user oriented output is produced. | |
126 | This includes fields USER, %CPU, NICE, SIZE, and RSS as described below. | |
127 | .TP 5 | |
128 | .B v | |
129 | A version of the output containing virtual memory statistics is output. | |
130 | This includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU | |
131 | and %MEM, described below. | |
132 | .TP 5 | |
133 | .B w | |
134 | Use a wide output format (132 columns rather than 80); if repeated, | |
135 | e.g. ww, use arbitrarily wide output. | |
136 | This information is used to decide how much of long commands to print. | |
137 | .TP 5 | |
138 | .B x | |
139 | asks even about processes with no terminal. | |
9a22b5c6 KM |
140 | .TP |
141 | .B U | |
3e284fd6 | 142 | causes ps to update a private database where it keeps system |
9a22b5c6 | 143 | information. Thus ``ps U'' should be included in the /etc/rc file. |
24115aa8 KM |
144 | .TP 5 |
145 | .B # | |
146 | A process number may be given, | |
147 | (indicated here by #), | |
148 | in which case the output | |
149 | is restricted to that process. | |
150 | This option must also be last. | |
151 | .PP | |
dee48434 KM |
152 | A second argument is taken |
153 | to be the file containing the system's | |
154 | namelist. Otherwise, /vmunix is used. | |
155 | A third argument tells | |
24115aa8 KM |
156 | .I ps |
157 | where to look for | |
158 | .I core | |
159 | if the | |
160 | .B k | |
161 | option is given, instead of /vmcore. | |
dee48434 KM |
162 | If a fourth argument is given, it |
163 | is taken to be the name of a swap file to use instead of | |
24115aa8 | 164 | the default /dev/drum. |
24115aa8 KM |
165 | .PP |
166 | Fields which are not common to all output formats: | |
167 | .PD 0 | |
168 | .IP USER 10 | |
169 | name of the owner of the process | |
170 | .IP %CPU 10 | |
171 | cpu utilization of the process; this is a decaying average over up to | |
172 | a minute of previous (real) time. Since the time base over which this | |
173 | is computed varies (since processes may be very young) it is possible | |
174 | for the sum of all %CPU fields to exceed 100%. | |
175 | .IP NICE 10 | |
176 | (or NI) process scheduling increment (see | |
dee48434 | 177 | .IR setpriority (2)) |
24115aa8 KM |
178 | .IP SIZE 10 |
179 | virtual size of the process (in 1024 byte units) | |
180 | .IP RSS 10 | |
181 | real memory (resident set) size of the process (in 1024 byte units) | |
182 | .IP LIM 10 | |
183 | soft limit on memory used, specified via a call to | |
dee48434 | 184 | .IR setrlimit (2); |
24115aa8 KM |
185 | if no limit has been specified then shown as \fIxx\fR |
186 | .IP TSIZ 10 | |
187 | size of text (shared program) image | |
188 | .IP TRS 10 | |
189 | size of resident (real memory) set of text | |
190 | .IP %MEM 10 | |
191 | percentage of real memory used by this process. | |
192 | .IP RE 10 | |
193 | residency time of the process (seconds in core) | |
194 | .IP SL 10 | |
195 | sleep time of the process (seconds blocked) | |
196 | .IP PAGEIN 10 | |
197 | number of disk i/o's resulting from references by the process | |
198 | to pages not loaded in core. | |
199 | .IP UID 10 | |
200 | numerical user-id of process owner | |
201 | .IP PPID 10 | |
202 | numerical id of parent of process | |
203 | .IP CP 10 | |
204 | short-term cpu utilization factor (used in scheduling) | |
205 | .IP PRI 10 | |
206 | process priority (non-positive when in non-interruptible wait) | |
207 | .IP ADDR 10 | |
208 | swap address of the process | |
209 | .IP WCHAN 10 | |
53829504 KM |
210 | event on which process is waiting (an address in the system). |
211 | A symbol is chosen that classifies the address, unless numerical | |
212 | output is requested (see the | |
213 | .B n | |
214 | flag). | |
215 | In this case, the initial part of the address is | |
216 | trimmed off and is printed hexadecimally, e.g., 0x80004000 prints as 4000. | |
24115aa8 KM |
217 | .sp |
218 | .IP F 10 | |
dee48434 KM |
219 | flags associated with process as in |
220 | .RI < sys/proc.h >: | |
24115aa8 KM |
221 | .br |
222 | .PP | |
223 | .sp | |
224 | .nf | |
225 | .ta 6n 18n 26n | |
226 | SLOAD 000001 in core | |
227 | SSYS 000002 swapper or pager process | |
228 | SLOCK 000004 process being swapped out | |
229 | SSWAP 000008 save area flag | |
230 | STRC 000010 process is being traced | |
231 | SWTED 000020 another tracing flag | |
232 | SULOCK 000040 user settable lock in core | |
233 | SPAGE 000080 process in page wait state | |
234 | SKEEP 000100 another flag to prevent swap out | |
235 | SDLYU 000200 delayed unlock of pages | |
236 | SWEXIT 000400 working on exiting | |
237 | SPHYSIO 000800 doing physical i/o (bio.c) | |
238 | SVFORK 001000 process resulted from vfork() | |
239 | SVFDONE 002000 another vfork flag | |
240 | SNOVM 004000 no vm, parent in a vfork() | |
dee48434 | 241 | SPAGI 008000 init data space on demand from inode |
24115aa8 KM |
242 | SANOM 010000 system detected anomalous vm behavior |
243 | SUANOM 020000 user warned of anomalous vm behavior | |
244 | STIMO 040000 timing out during sleep | |
245 | SDETACH 080000 detached inherited by init | |
dee48434 | 246 | SOUSIG 100000 using old signal mechanism |
24115aa8 KM |
247 | .fi |
248 | .PD | |
249 | .PP | |
c3f41f75 AH |
250 | A process that has exited and has a parent that has not |
251 | yet waited for the process is marked <defunct>; a process | |
24115aa8 KM |
252 | which is blocked trying to exit is marked <exiting>; |
253 | .I Ps | |
254 | makes an educated guess as to the file name | |
255 | and arguments given when the process was created | |
256 | by examining memory or the swap area. | |
257 | The method is inherently somewhat unreliable and in any event | |
258 | a process is entitled to destroy this information, | |
259 | so the names cannot be counted on too much. | |
260 | .SH FILES | |
9a22b5c6 | 261 | .ta \w'/etc/psdatabase 'u |
24115aa8 KM |
262 | /vmunix system namelist |
263 | .br | |
264 | /dev/kmem kernel memory | |
265 | .br | |
266 | /dev/drum swap device | |
267 | .br | |
268 | /vmcore core file | |
269 | .br | |
270 | /dev searched to find swap device and tty names | |
9a22b5c6 | 271 | .br |
53829504 | 272 | /etc/psdatabase system namelist, device, and wait channel information |
24115aa8 KM |
273 | .SH "SEE ALSO" |
274 | kill(1), w(1) | |
275 | .SH BUGS | |
276 | Things can change while | |
277 | .I ps | |
278 | is running; the picture it gives is only a close | |
279 | approximation to reality. |