ps.1 (12483B)
1 '\" t 2 .\" Sccsid @(#)ps.1 1.48 (gritter) 8/19/08 3 .\" Parts taken from ps(1), Unix 7th edition: 4 .\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 5 .\" 6 .\" Redistribution and use in source and binary forms, with or without 7 .\" modification, are permitted provided that the following conditions 8 .\" are met: 9 .\" Redistributions of source code and documentation must retain the 10 .\" above copyright notice, this list of conditions and the following 11 .\" disclaimer. 12 .\" Redistributions in binary form must reproduce the above copyright 13 .\" notice, this list of conditions and the following disclaimer in the 14 .\" documentation and/or other materials provided with the distribution. 15 .\" All advertising materials mentioning features or use of this software 16 .\" must display the following acknowledgement: 17 .\" This product includes software developed or owned by Caldera 18 .\" International, Inc. 19 .\" Neither the name of Caldera International, Inc. nor the names of 20 .\" other contributors may be used to endorse or promote products 21 .\" derived from this software without specific prior written permission. 22 .\" 23 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 24 .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 25 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 .\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE 28 .\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 31 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 32 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 33 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 34 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 .TH PS 1 "8/19/08" "Heirloom Toolchest" "User Commands" 36 .SH NAME 37 ps \- process status 38 .SH SYNOPSIS 39 .HP 40 .ad l 41 .nh 42 \fBps\fR [\-\fBaAcdefjlLPRy\fR] 43 [\fB\-o\fI property\fR[\fB=\fR[\fItitle\fR]], ...\fR]\ ... 44 [\fB\-gGpstuU\fI\ criteria\fR, ...]\ ... 45 [\fB\-r \fIsysname\fR] 46 .br 47 .hy 1 48 .ad b 49 .SH DESCRIPTION 50 .B Ps 51 prints certain indicia about active processes. 52 If no options are specified, 53 all processes on the current terminal are selected; 54 .B /usr/5bin/posix/ps 55 and 56 .B /usr/5bin/posix2001/ps 57 further restrict this to processes owned by the invoking user. 58 The selection can be changed 59 by adding 60 .I criteria 61 with the options below; 62 when a process satifies any criterion, 63 it is selected. 64 A 65 .I criteria 66 string can consist 67 of multiple criteria 68 separated by blanks or commas. 69 .PP 70 By default, 71 .B ps 72 prints the process id, 73 controlling terminal device, 74 cumulative execution time 75 and command of processes. 76 .PP 77 The 78 .B ps 79 command accepts the following options: 80 .TP 12 81 .B \-a 82 Selects all processes with a controlling terminal device, 83 except for session leaders. 84 .TP 12 85 .B \-c 86 Adds scheduling class and priority to the output. 87 This is the default with 88 .BR /usr/5bin/s42/ps . 89 See below for the meaning of columns. 90 .TP 12 91 .B \-d 92 Selects all processes except session leaders. 93 .TP 12 94 .B \-e 95 Selects all processes. 96 .TP 12 97 .B \-f 98 Full listing; 99 adds user name, parent process id, 100 processor utilization, 101 and the time when the process was started. 102 See below for the meaning of columns. 103 .TP 12 104 \fB\-g\fI pgrplist\fR 105 For 106 .B /usr/5bin/ps 107 and 108 .BR /usr/5bin/s42/ps , 109 all processes that belong to one of the process groups ids in 110 .I pgrplist 111 are selected; 112 for 113 .B /usr/5bin/posix/ps 114 and 115 .BR /usr/5bin/posix2001/ps , 116 all processes that belong to one of the session ids in 117 .IR group . 118 .TP 12 119 .B \-j 120 Adds process group id and session id to the output. 121 See below for the meaning of columns. 122 .TP 12 123 .B \-l 124 Long listing; 125 adds process flags, process state, 126 numeric user id, 127 parent process id, 128 processor utilization, 129 priority, nice value, 130 core address, 131 memory size in pages and the event waited for. 132 See below for the meaning of columns. 133 .TP 12 134 \fB\-p\fI pidlist\fR 135 Selects all processes with one of the given \fIprocess ids\fR. 136 .TP 12 137 \fB\-r\fI sysname\fR 138 Change the root directory to 139 .IR sysname , 140 which may be either an absolute pathname 141 or the basename component of a mounted file system. 142 Requires presence of a selection criterion. 143 .TP 12 144 \fB\-s\fI sidlist\fR 145 Selects all processes that belong to one of the session ids in 146 .IR sidlist . 147 .TP 12 148 \fB\-t\fI device\fR 149 Selects all processes with the current terminal 150 .IR device . 151 This may be the device name with either 152 .B /dev/ 153 or 154 .B /dev/tty 155 omitted, 156 as in 157 .I ttyS2 158 or 159 .I S2 160 for 161 .IR /dev/ttyS2 . 162 .TP 12 163 \fB\-u\fI uidlist\fR 164 Selects all processes with one of the given \fIuser ids\fR, 165 which may be symbolic or numeric. 166 The real user id is used with 167 .B /usr/5bin/ps 168 and 169 .BR /usr/5bin/s42/ps , 170 the effective user id with 171 .B /usr/5bin/posix/ps 172 and 173 .BR /usr/5bin/posix2001/ps . 174 .PP 175 The following options have been introduced by POSIX.2: 176 .TP 12 177 .B \-A 178 Selects all processes. 179 .TP 12 180 \fB\-G\fI gidlist\fR 181 Selects all processes that have one of the specified real \fIgroup ids\fR, 182 which may be symbolic or numeric. 183 .TP 12 184 \fB\-o\fI property\fR[\fB=\fR[\fItitle\fR]],... 185 The output is changed to reflect the named 186 .IR property . 187 Multiple properties can be given, 188 separated by blanks or commas; 189 it is also possible to specify multiple 190 .B \-o 191 options. 192 Normally, the default property description is 193 written in the first output line. 194 If the 195 .B = 196 character is present, but the 197 .I title 198 is missing in all format specifications, 199 no descriptions are printed; 200 if a 201 .I title 202 is given, it is used instead of the default. 203 See below for valid 204 .I property 205 strings. 206 .TP 12 207 \fB\-U\fI uidlist\fR 208 Selects all processes with one of the given real \fIuser ids\fR, 209 which may be symbolic or numeric. 210 .PP 211 The following options are extensions: 212 .TP 12 213 .B \-L 214 .hw LWPs 215 Prints information on lightweight processes (LWPs); 216 adds lightweight process id, 217 lightweight process time, 218 and, if \fI\-f\fR is also present, 219 the number of lightweight processes. 220 See below for the meaning of columns. 221 .TP 12 222 .B \-P 223 Prints the processor on which the process is currently running. 224 Disables printing of flags and memory address. 225 .TP 12 226 .B \-R 227 Resource usage format; 228 prints process id, 229 memory and resident set size in pages, 230 buffer reads and writes, 231 messages sent and received, 232 user and system time, 233 and command. 234 See below for the meaning of columns. 235 .TP 12 236 .B \-y 237 Modifies the 238 .B \-l 239 output format; 240 process flags, address and size in pages are omitted, 241 and resident set size 242 and memory size in kilobytes are printed instead. 243 .PP 244 The meaning of columns and column headings 245 for the 246 .BR \-c , 247 .BR \-f , 248 .BR \-j , 249 .BR \-l 250 and 251 .B \-P 252 options are as follows 253 (the letters given in parentheses specify which option 254 causes the column to appear; 255 \fIall\fR means that the column is always printed): 256 .PP 257 .TS 258 l2 l2 l s s 259 l2 l2 l2 l4 l. 260 F (l) T{ 261 Flags associated with the process 262 (octal and additive): 263 T} 264 01 in core; 265 02 system process; 266 04 T{ 267 locked in core (e.g. for physical I/O); 268 T} 269 10 being swapped; 270 20 being traced by another process. 271 .T& 272 l2 l2 l s s 273 l2 l2 l2 l4 l. 274 S (l) The state of the process: 275 O running on a processor; 276 R runnable (on run queue); 277 S sleeping; 278 I intermediate; 279 Z terminated; 280 T stopped; 281 X allocating memory. 282 .T& 283 l2 l2 l s s. 284 UID (f,l) T{ 285 The real user ID of the process owner, 286 or, for \fB/usr/5bin/posix/ps\fR 287 and \fB/usr/5bin/posix2001/ps\fR, 288 the effective user ID. 289 With the \fB\-l\fR 290 option, 291 a numeric ID is printed, 292 otherwise the user name. 293 T} 294 PID (all) T{ 295 The process id of the process; 296 as in certain cults 297 it is possible to kill a process 298 if you know its true name. 299 T} 300 PPID (f,j,l) The process ID of the parent process. 301 PGID (j) The process group ID of the process. 302 SID (j) The session ID of the process. 303 LWP (L) The lightweight process ID of the process. 304 NLWP (fL) T{ 305 The number of lightweight processes 306 in the process. 307 T} 308 PSR (P) T{ 309 The processor on which the process is currently running. 310 T} 311 C (f,l) Processor utilization for scheduling. 312 CLS (c) Scheduling class. 313 PRI (c,l) T{ 314 Priority. 315 With \fB\-l\fR, high numbers mean low priority. 316 With \fB\-c\fR, high numbers mean high priority; 317 time-sharing processes have priorities below 60; 318 for real-time processes, 319 the priority is computed as \fI100 + scheduling priority.\fR 320 T} 321 NI (l) Nice value, used in priority computation. 322 ADDR (l) The core address of the process. 323 RSS (ly) T{ 324 The amount of memory in kilobytes 325 currently present in core. 326 T} 327 SZ (l,R) T{ 328 The size in pages of the core image of the process. 329 If the \fB\-y\fR option is also given, 330 the size is printed in kilobytes. 331 T} 332 MRSZ (R) T{ 333 The amount of memory in pages 334 currently present in core. 335 T} 336 PFLTS (R) T{ 337 The number of major page faults 338 that have occurred with the process. 339 T} 340 BUFR (R) T{ 341 Buffer reads performed on behalf of the process. 342 T} 343 BUFW (R) T{ 344 Buffer writes performed on behalf of the process. 345 T} 346 MRCV (R) T{ 347 Messages received by the process. 348 T} 349 MSND (R) T{ 350 Messages sent by the process. 351 T} 352 WCHAN (l) T{ 353 The event for which the process is waiting or sleeping; 354 if blank, the process is running. 355 T} 356 .\" Trailing no-break-spaces guarantee a minimum table width for nroff 357 .\" without restricting troff to select the same. 358 STIME (f) The time when the process was started.\ \ \ \ \ \ 359 TTY (all) T{ 360 The controlling tty for the process. 361 T} 362 TIME (all) T{ 363 The cumulative execution time for the process. 364 T} 365 LTIME (L) T{ 366 The cumulative execution time for the lightweight process. 367 T} 368 UTIME (R) T{ 369 The cumulative time the process spent in user mode. 370 T} 371 KTIME (R) T{ 372 The cumulative time the process spent in system (kernel) mode. 373 T} 374 COMD (all) T{ 375 The command name; 376 with the \fB\-f\fR option, 377 the command line. 378 The heading `CMD' is printed 379 for \fB/usr/5bin/posix/ps\fR 380 and \fB/usr/5bin/posix2001/ps\fR; 381 the heading `COMMAND' is printed 382 if the \fBSYSV3\fR 383 environment variable is set 384 and the \fI\-l\fR option is not present. 385 T} 386 .TE 387 .PP 388 A process that has exited and has a parent, 389 but has not yet been waited for by the parent 390 is marked 391 .IR <defunct> . 392 .PP 393 For the 394 .B \-o 395 option, the following properties 396 (listed with their default column headings) 397 can be given: 398 .PP 399 .TS 400 l2fB l2 l. 401 user USER Effective user name. 402 ruser RUSER Real user name. 403 group GROUP Effective group name. 404 rgroup RGROUP Real group name. 405 pid PID Process id. 406 ppid PPID Parent process id. 407 pgid PGID Process group id. 408 sid SID Session id. 409 class CLASS Scheduling class. 410 pcpu %CPU Processor usage in percent. 411 vsz VSZ Memory usage in kilobytes. 412 nice NI Nice value. 413 etime ELAPSED Time elapsed since the process was started. 414 time TIME Cumulative execution time. 415 tty TTY Controlling terminal device. 416 comm COMMAND The first command line argument. 417 args COMMAND Command line arguments separated by spaces. 418 f F Process flags. 419 s S Process state. 420 c C Processor utilization for scheduling. 421 uid UID Numeric effective user id. 422 ruid RUID Numeric real user id. 423 gid GID Numeric effective group id. 424 rgid RGID Numeric real group id. 425 pri PRI Priority; high numbers mean high priority. 426 opri PRI Priority; high numbers mean low priority. 427 psr PSR Processor. 428 addr ADDR Core address. 429 osz SZ Memory size in pages. 430 wchan WCHAN Event for which the process is waiting. 431 stime STIME T{ 432 Start time of the process (may contain whitespace). 433 T} 434 rss RSS Resident set size in kilobytes. 435 pmem %MEM Memory usage in percent. 436 fname COMMAND T{ 437 .ad l 438 .nr ol \n(.l 439 .ll 39n 440 The first eight characters of the executable file for the process. 441 .br 442 .ll \n(olu 443 .ad b 444 T} 445 .TE 446 .PP 447 For those properties that correspond to user or group names, 448 the numeric id is printed 449 if the name does not fit into the column width. 450 .SH "ENVIRONMENT VARIABLES" 451 .TP 452 .BR LANG ", " LC_ALL 453 See 454 .IR locale (7). 455 .TP 456 .B LC_CTYPE 457 Determines the set of printable characters 458 and the character width. 459 Non-printable characters in arguments and file names 460 are dropped if writing to a terminal. 461 .TP 462 .B LC_TIME 463 Affects the format of date and time strings printed. 464 .TP 465 .B SYSV3 466 Changes the text of some headings as described above. 467 .SH FILES 468 .TP 469 .B /etc/passwd 470 Used for converting numeric and symbolic user ids. 471 .TP 472 .B /etc/group 473 Used for converting numeric and symbolic group ids. 474 .TP 475 .B /etc/default/ps 476 .TP 477 .B /proc/ 478 .TP 479 .B /dev/ 480 .SH "SEE ALSO" 481 nice(1), 482 kill(1), 483 priocntl(1), 484 proc(5), 485 locale(7) 486 .SH NOTES 487 Things can change while ps is running; 488 the picture it gives is only a close approximation to reality.