Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/ps.1.man.txt
+++ new/usr/src/man/man1/ps.1.man.txt
1 1 PS(1) User Commands PS(1)
2 2
3 3
4 4
5 5 NAME
6 6 ps - report process status
7 7
8 8 SYNOPSIS
9 9 ps [-aAcdefjHlLPWyZ] [-g grplist] [-h lgrplist]
10 10 [-n namelist] [-o format]... [-p proclist]
11 11 [-s sidlist] [-t term] [-u uidlist] [-U uidlist]
12 12 [-G gidlist] [-z zonelist]
13 13
14 14
15 15 DESCRIPTION
16 16 The ps command prints information about active processes. Without
17 17 options, ps prints information about processes that have the same
18 18 effective user ID and the same controlling terminal as the invoker. The
19 19 output contains only the process ID, terminal identifier, cumulative
20 20 execution time, and the command name. Otherwise, the information that
21 21 is displayed is controlled by the options.
22 22
23 23
24 24 Some options accept lists as arguments. Items in a list can be either
25 25 separated by commas or else enclosed in quotes and separated by commas
26 26 or spaces. Values for proclist and grplist must be numeric.
27 27
28 28 OPTIONS
29 29 The following options are supported:
30 30
31 31 -a
32 32 Lists information about all processes most frequently
33 33 requested: all those except session leaders and
34 34 processes not associated with a terminal.
35 35
36 36 This option is ignored when the -e option is also
37 37 specified.
38 38
39 39
40 40 -A
41 41 Lists information for all processes. Identical to -e,
42 42 below.
43 43
44 44
45 45 -c
46 46 Prints information in a format that reflects scheduler
47 47 properties as described in priocntl(1). The -c option
48 48 affects the output of the -f and -l options, as
49 49 described below.
50 50
51 51
52 52 -d
53 53 Lists information about all processes except session
54 54 leaders.
55 55
56 56
57 57 -e
58 58 Lists information about every process now running.
59 59
60 60 When the -e option is specified, options -z, -t, -u, -U,
61 61 -g, -G, -p, -h, -s and -a have no effect.
62 62
63 63
64 64 -f
65 65 Generates a full listing. (See below for significance of
66 66 columns in a full listing.)
67 67
68 68
69 69 -g grplist
70 70 Lists only process data whose group leader's ID
71 71 number(s) appears in grplist. (A group leader is a
72 72 process whose process ID number is identical to its
73 73 process group ID number.)
74 74
75 75 This option is ignored when the -e option is also
76 76 specified.
77 77
78 78
79 79 -G gidlist
80 80 Lists information for processes whose real group ID
81 81 numbers are given in gidlist. The gidlist must be a
82 82 single argument in the form of a blank- or comma-
83 83 separated list.
84 84
85 85 This option is ignored when the -e option is also
86 86 specified.
87 87
88 88
89 89 -h lgrplist
90 90 Lists only the processes homed to the specified
91 91 lgrplist. Nothing is listed for any invalid group
92 92 specified in lgrplist.
93 93
94 94 This option is ignored when the -e option is also
95 95 specified.
96 96
97 97
98 98 -H
99 99 Prints the home lgroup of the process under an
100 100 additional column header, LGRP.
101 101
102 102
103 103 -j
104 104 Prints session ID and process group ID.
105 105
106 106
107 107 -l
108 108 Generates a long listing. (See below.)
109 109
110 110
111 111 -L
112 112 Prints information about each light weight process (lwp)
113 113 in each selected process. (See below.)
114 114
115 115
116 116 -n namelist
117 117 Specifies the name of an alternative system namelist
118 118 file in place of the default. This option is accepted
119 119 for compatibility, but is ignored.
120 120
121 121
122 122 -o format
123 123 Prints information according to the format specification
124 124 given in format. This is fully described in DISPLAY
125 125 FORMATS. Multiple -o options can be specified; the
126 126 format specification is interpreted as the space-
127 127 character-separated concatenation of all the format
128 128 option-arguments.
129 129
130 130
131 131 -p proclist
132 132 Lists only process data whose process ID numbers are
133 133 given in proclist.
134 134
135 135 This option is ignored when the -e option is also
136 136 specified.
137 137
138 138
139 139 -P
140 140 Prints the number of the processor to which the process
141 141 or lwp is bound, if any, under an additional column
142 142 header, PSR.
143 143
144 144
145 145 -s sidlist
146 146 Lists information on all session leaders whose IDs
147 147 appear in sidlist.
148 148
149 149 This option is ignored when the -e option is also
150 150 specified.
151 151
152 152
153 153 -t term
154 154 Lists only process data associated with term. Terminal
155 155 identifiers are specified as a device file name, and an
156 156 identifier. For example, term/a, or pts/0.
157 157
158 158 This option is ignored when the -e option is also
159 159 specified.
160 160
161 161
162 162 -u uidlist
163 163 Lists only process data whose effective user ID number
164 164 or login name is given in uidlist. In the listing, the
165 165 numerical user ID is printed unless you give the -f
166 166 option, which prints the login name.
167 167
168 168 This option is ignored when the -e option is also
169 169 specified.
170 170
171 171
172 172 -U uidlist
173 173 Lists information for processes whose real user ID
174 174 numbers or login names are given in uidlist. The uidlist
175 175 must be a single argument in the form of a blank- or
176 176 comma-separated list.
177 177
178 178 This option is ignored when the -e option is also
179 179 specified.
180 180
181 181
182 182 -W
183 183 Truncate long names even when ps would normally print
184 184 them in full. A trailing asterisk marks a long name
185 185 that has been truncated to fit the column.
186 186
187 187
188 188 -y
189 189 Under a long listing (-l), omits the obsolete F and ADDR
190 190 columns and includes an RSS column to report the
191 191 resident set size of the process. Under the -y option,
192 192 both RSS and SZ (see below) is reported in units of
193 193 kilobytes instead of pages.
194 194
195 195
196 196 -z zonelist
197 197 Lists only processes in the specified zones. Zones can
198 198 be specified either by name or ID. This option is only
199 199 useful when executed in the global zone.
200 200
201 201 This option is ignored when the -e option is also
202 202 specified.
203 203
204 204
205 205 -Z
206 206 Prints the name of the zone with which the process is
207 207 associated under an additional column header, ZONE. The
208 208 ZONE column width is limited to 8 characters. Use ps -eZ
209 209 for a quick way to see information about every process
210 210 now running along with the associated zone name. Use
211 211
212 212 ps -eo zone,uid,pid,ppid,time,comm,...
213 213
214 214
215 215 to see zone names wider than 8 characters.
216 216
217 217
218 218
219 219 Many of the options shown are used to select processes to list. If any
220 220 are specified, the default list is ignored and ps selects the processes
221 221 represented by the inclusive OR of all the selection-criteria options.
222 222
223 223 DISPLAY FORMATS
224 224 Under the -f option, ps tries to determine the command name and
225 225 arguments given when the process was created by examining the user
226 226 block. Failing this, the command name is printed, as it would have
227 227 appeared without the -f option, in square brackets.
228 228
229 229
230 230 The column headings and the meaning of the columns in a ps listing are
231 231 given below; the letters f and l indicate the option (full or long,
232 232 respectively) that causes the corresponding heading to appear; all
233 233 means that the heading always appears. Note: These two options
234 234 determine only what information is provided for a process; they do not
235 235 determine which processes are listed.
236 236
237 237 F(l)
238 238 Flags (hexadecimal and additive) associated with the
239 239 process. These flags are available for historical
240 240 purposes; no meaning should be currently ascribed to
241 241 them.
242 242
243 243
244 244 S (l)
245 245 The state of the process:
246 246
247 247 O
248 248 Process is running on a processor.
249 249
250 250
251 251 S
252 252 Sleeping: process is waiting for an event to
253 253 complete.
254 254
255 255
256 256 R
257 257 Runnable: process is on run queue.
258 258
259 259
260 260 T
261 261 Process is stopped, either by a job control signal
262 262 or because it is being traced.
263 263
264 264
265 265 W
266 266 Waiting: process is waiting for CPU usage to drop to
267 267 the CPU-caps enforced limits.
268 268
269 269
270 270 Z
271 271 Zombie state: process terminated and parent not
272 272 waiting.
273 273
274 274
275 275
276 276 UID (f,l)
277 277 The effective user ID number of the process (the login
278 278 name is printed under the -f option). A trailing
279 279 asterisk marks a long name that has been truncated to fit
280 280 the column.
281 281
282 282
283 283 PID(all)
284 284 The process ID of the process (this datum is necessary in
285 285 order to kill a process).
286 286
287 287
288 288 PPID(f,l)
289 289 The process ID of the parent process.
290 290
291 291
292 292 C(f,l)
293 293 Processor utilization for scheduling (obsolete). Not
294 294 printed when the -c option is used.
295 295
296 296
297 297 CLS(f,l)
298 298 Scheduling class. Printed only when the -c option is
299 299 used.
300 300
301 301
302 302 PRI(l)
303 303 The priority of the process. Without the -c option,
304 304 higher numbers mean lower priority. With the -c option,
305 305 higher numbers mean higher priority.
306 306
307 307
308 308 NI(l)
309 309 Nice value, used in priority computation. Not printed
310 310 when the -c option is used. Only processes in the certain
311 311 scheduling classes have a nice value.
312 312
313 313
314 314 ADDR(l)
315 315 The memory address of the process.
316 316
317 317
318 318 SZ(l)
319 319 The total size of the process in virtual memory,
320 320 including all mapped files and devices, in pages. See
321 321 pagesize(1).
322 322
323 323
324 324 WCHAN(l)
325 325 The address of an event for which the process is sleeping
326 326 (if blank, the process is running).
327 327
328 328
329 329 STIME(f)
330 330 The starting time of the process, given in hours,
331 331 minutes, and seconds. (A process begun more than twenty-
332 332 four hours before the ps inquiry is executed is given in
333 333 months and days.)
334 334
335 335
336 336 TTY(all)
337 337 The controlling terminal for the process (the message, ?,
338 338 is printed when there is no controlling terminal).
339 339
340 340
341 341 TIME(all)
342 342 The cumulative execution time for the process.
343 343
344 344
345 345 LTIME(all)
346 346 The execution time for the lwp being reported.
347 347
348 348
349 349 CMD(all)
350 350 The command name (the full command name and its
351 351 arguments, up to a limit of 80 characters, are printed
352 352 under the -f option).
353 353
354 354
355 355
356 356 The following two additional columns are printed when the -j option is
357 357 specified:
358 358
359 359 PGID
360 360 The process ID of the process group leader.
361 361
362 362
363 363 SID
364 364 The process ID of the session leader.
365 365
366 366
367 367
368 368 The following two additional columns are printed when the -L option is
369 369 specified:
370 370
371 371 LWP
372 372 The lwp ID of the lwp being reported.
373 373
374 374
375 375 NLWP
376 376 The number of lwps in the process (if -f is also specified).
377 377
378 378
379 379
380 380 Under the -L option, one line is printed for each lwp in the process
381 381 and the time-reporting fields STIME and LTIME show the values for the
382 382 lwp, not the process. A traditional single-threaded process contains
383 383 only one lwp.
384 384
385 385
386 386 A process that has exited and has a parent, but has not yet been waited
387 387 for by the parent, is marked <defunct>.
388 388
389 389 -o format
390 390 The -o option allows the output format to be specified under user
391 391 control.
392 392
393 393
394 394 The format specification must be a list of names presented as a single
395 395 argument, blank- or comma-separated. Each variable has a default
396 396 header. The default header can be overridden by appending an equals
397 397 sign and the new text of the header. The rest of the characters in the
398 398 argument is used as the header text. The fields specified are written
399 399 in the order specified on the command line, and should be arranged in
400 400 columns in the output. The field widths are selected by the system to
401 401 be at least as wide as the header text (default or overridden value).
402 402 If the header text is null, such as -o user=, the field width is at
403 403 least as wide as the default header text. Long names are not truncated
404 404 in this mode. If all header text fields are null, no header line is
405 405 written.
406 406
407 407
408 408 The following names are recognized in the POSIX locale:
409 409
410 410 user
411 411 The effective user ID of the process. This is the textual
412 412 user ID, if it can be obtained and the field width permits,
413 413 or a decimal representation otherwise.
414 414
415 415
416 416 ruser
417 417 The real user ID of the process. This is the textual user ID,
418 418 if it can be obtained and the field width permits, or a
419 419 decimal representation otherwise.
420 420
421 421
422 422 group
423 423 The effective group ID of the process. This is the textual
424 424 group ID, if it can be obtained and the field width permits,
425 425 or a decimal representation otherwise.
426 426
427 427
428 428 rgroup
429 429 The real group ID of the process. This is the textual group
430 430 ID, if it can be obtained and the field width permits, or a
431 431 decimal representation otherwise.
432 432
433 433
434 434 pid
435 435 The decimal value of the process ID.
436 436
437 437
438 438 ppid
439 439 The decimal value of the parent process ID.
440 440
441 441
442 442 pgid
443 443 The decimal value of the process group ID.
444 444
445 445
446 446 pcpu
447 447 The ratio of CPU time used recently to CPU time available in
448 448 the same period, expressed as a percentage. The meaning of
449 449 ``recently'' in this context is unspecified. The CPU time
450 450 available is determined in an unspecified manner.
451 451
452 452
453 453 vsz
454 454 The total size of the process in virtual memory, in
455 455 kilobytes.
456 456
457 457
458 458 nice
459 459 The decimal value of the system scheduling priority of the
460 460 process. See nice(1).
461 461
462 462
463 463 etime
464 464 In the POSIX locale, the elapsed time since the process was
465 465 started, in the form:
466 466
467 467 [[dd-]hh:]mm:ss
468 468
469 469 where
470 470
471 471 dd
472 472 is the number of days
473 473
474 474
475 475 hh
476 476 is the number of hours
477 477
478 478
479 479 mm
480 480 is the number of minutes
481 481
482 482
483 483 ss
484 484 is the number of seconds
485 485
486 486 The dd field is a decimal integer. The hh, mm and ss fields
487 487 is two-digit decimal integers padded on the left with zeros.
488 488
489 489
490 490 time
491 491 In the POSIX locale, the cumulative CPU time of the process
492 492 in the form:
493 493
494 494 [dd-]hh:mm:ss
495 495
496 496 The dd, hh, mm, and ss fields is as described in the etime
497 497 specifier.
498 498
499 499
500 500 tty
501 501 The name of the controlling terminal of the process (if any)
502 502 in the same format used by the who(1) command.
503 503
504 504
505 505 comm
506 506 The name of the command being executed (argv[0] value) as a
507 507 string.
508 508
509 509
510 510 args
511 511 The command with all its arguments as a string. The
512 512 implementation might truncate this value to the field width;
513 513 it is implementation-dependent whether any further truncation
514 514 occurs. It is unspecified whether the string represented is a
515 515 version of the argument list as it was passed to the command
516 516 when it started, or is a version of the arguments as they
517 517 might have been modified by the application. Applications
518 518 cannot depend on being able to modify their argument list and
519 519 having that modification be reflected in the output of ps.
520 520 The Solaris implementation limits the string to 80 bytes; the
521 521 string is the version of the argument list as it was passed
522 522 to the command when it started.
523 523
524 524
525 525
526 526 The following names are recognized in the Solaris implementation:
527 527
528 528 f
529 529 Flags (hexadecimal and additive) associated with the
530 530 process.
531 531
532 532
533 533 s
534 534 The state of the process.
535 535
536 536
537 537 c
538 538 Processor utilization for scheduling (obsolete).
539 539
540 540
541 541 uid
542 542 The effective user ID number of the process as a decimal
543 543 integer.
544 544
545 545
546 546 ruid
547 547 The real user ID number of the process as a decimal integer.
548 548
549 549
550 550 gid
551 551 The effective group ID number of the process as a decimal
552 552 integer.
553 553
554 554
555 555 rgid
556 556 The real group ID number of the process as a decimal
557 557 integer.
558 558
559 559
560 560 projid
561 561 The project ID number of the process as a decimal integer.
562 562
563 563
564 564 project
565 565 The project ID of the process as a textual value if that
566 566 value can be obtained; otherwise, as a decimal integer.
567 567
568 568
569 569 zoneid
570 570 The zone ID number of the process as a decimal integer.
571 571
572 572
573 573 zone
574 574 The zone ID of the process as a textual value if that value
575 575 can be obtained; otherwise, as a decimal integer.
576 576
577 577
578 578 sid
579 579 The process ID of the session leader.
580 580
581 581
582 582 taskid
583 583 The task ID of the process.
584 584
585 585
586 586 class
587 587 The scheduling class of the process.
588 588
589 589
590 590 pri
591 591 The priority of the process. Higher numbers mean higher
592 592 priority.
593 593
594 594
595 595 opri
↓ open down ↓ |
595 lines elided |
↑ open up ↑ |
596 596 The obsolete priority of the process. Lower numbers mean
597 597 higher priority.
598 598
599 599
600 600 lwp
601 601 The decimal value of the lwp ID. Requesting this formatting
602 602 option causes one line to be printed for each lwp in the
603 603 process.
604 604
605 605
606 + lwpname
607 + The name of the lwp, if set. Requesting this formatting
608 + option causes one line to be printed for each lwp in the
609 + process.
610 +
611 +
606 612 nlwp
607 613 The number of lwps in the process.
608 614
609 615
610 616 psr
611 617 The number of the processor to which the process or lwp is
612 618 bound.
613 619
614 620
615 621 pset
616 622 The ID of the processor set to which the process or lwp is
617 623 bound.
618 624
619 625
620 626 addr
621 627 The memory address of the process.
622 628
623 629
624 630 osz
625 631 The total size of the process in virtual memory, in pages.
626 632
627 633
628 634 wchan
629 635 The address of an event for which the process is sleeping
630 636 (if -, the process is running).
631 637
632 638
633 639 stime
634 640 The starting time or date of the process, printed with no
635 641 blanks.
636 642
637 643
638 644 rss
639 645 The resident set size of the process, in kilobytes. The rss
640 646 value reported by ps is an estimate provided by proc(4) that
641 647 might underestimate the actual resident set size. Users who
642 648 wish to get more accurate usage information for capacity
643 649 planning should use pmap(1) -x instead.
644 650
645 651
646 652 pmem
647 653 The ratio of the process's resident set size to the physical
648 654 memory on the machine, expressed as a percentage.
649 655
650 656
651 657 fname
652 658 The first 8 bytes of the base name of the process's
653 659 executable file.
654 660
655 661
656 662 ctid
657 663 The contract ID of the process contract the process is a
658 664 member of as a decimal integer.
659 665
660 666
661 667 lgrp
↓ open down ↓ |
46 lines elided |
↑ open up ↑ |
662 668 The home lgroup of the process.
663 669
664 670
665 671 dmodel
666 672 The data model of the process, printed in the same manner as
667 673 via pflags(1). The currently supported data models are
668 674 _ILP32 and _LP64.
669 675
670 676
671 677
672 - Only comm and args are allowed to contain blank characters; all others,
673 - including the Solaris implementation variables, are not.
678 + Only comm, lwpname, and args are allowed to contain blank characters;
679 + all others, including the Solaris implementation variables, are not.
674 680
675 681
676 682 The following table specifies the default header to be used in the
677 683 POSIX locale corresponding to each format specifier.
678 684
679 685
680 686
681 687
682 688 +------------------------------------------+
683 689 | Format Default Format Default |
684 690 |Specifier Header Specifier Header |
685 691 +------------------------------------------+
686 692 | args COMMAND ppid PPID |
687 693 | comm COMMAND rgroup RGROUP |
688 694 | etime ELAPSED ruser RUSER |
689 695 | group GROUP time TIME |
690 696 | nice NI tty TT |
691 697 | pcpu %CPU user USER |
692 698 | pgid PGID vsz VSZ |
693 699 | pid PID |
694 700 +------------------------------------------+
695 701
696 702
697 703 The following table lists the Solaris implementation format specifiers
698 704 and the default header used with each.
699 705
700 706
701 707
702 708
703 709 +------------------------------------------+
704 710 | Format Default Format Default |
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
705 711 |Specifier Header Specifier Header |
706 712 +------------------------------------------+
707 713 | addr ADDR projid PROJID |
708 714 | c C project PROJECT |
709 715 | class CLS psr PSR |
710 716 | f F rgid RGID |
711 717 | fname COMMAND rss RSS |
712 718 | gid GID ruid RUID |
713 719 | lgrp LGRP s S |
714 720 | lwp LWP sid SID |
715 - | nlwp NLWP stime STIME |
716 - | opri PRI taskid TASKID |
717 - | osz SZ uid UID |
718 - | pmem %MEM wchan WCHAN |
719 - | pri PRI zone ZONE |
720 - | ctid CTID zoneid ZONEID |
721 + | lwpname LWPNAME stime STIME |
722 + | nlwp NLWP taskid TASKID |
723 + | opri PRI uid UID |
724 + | osz SZ wchan WCHAN |
725 + | pmem %MEM zone ZONE |
726 + | pri PRI zoneid ZONEID |
727 + | ctid CTID |
721 728 +------------------------------------------+
722 729
723 730 EXAMPLES
724 731 Example 1 Using ps Command
725 732
726 733
727 734 The command:
728 735
729 736
730 737 example% ps -o user,pid,ppid=MOM -o args
731 738
732 739
733 740
734 741
735 742 writes the following in the POSIX locale:
736 743
737 744
738 745 USER PID MOM COMMAND
739 746 helene 34 12 ps -o uid,pid,ppid=MOM -o args
740 747
741 748
742 749
743 750
744 751 The contents of the COMMAND field need not be the same due to possible
745 752 truncation.
746 753
747 754
748 755 ENVIRONMENT VARIABLES
749 756 See environ(5) for descriptions of the following environment variables
750 757 that affect the execution of ps: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
751 758 LC_TIME, and NLSPATH.
752 759
753 760 COLUMNS
754 761 Override the system-selected horizontal screen size, used to
755 762 determine the number of text columns to display.
756 763
757 764
758 765 EXIT STATUS
759 766 The following exit values are returned:
760 767
761 768 0
762 769 Successful completion.
763 770
764 771
765 772 >0
766 773 An error occurred.
767 774
768 775
769 776 FILES
770 777 /dev/pts/*
771 778
772 779
773 780
774 781 /dev/term/*
775 782 terminal (``tty'') names searcher files
776 783
777 784
778 785 /etc/passwd
779 786 UID information supplier
780 787
781 788
782 789 /proc/*
783 790 process control files
784 791
785 792
786 793 ATTRIBUTES
787 794 See attributes(5) for descriptions of the following attributes:
788 795
789 796
790 797
791 798
792 799 +--------------------+---------------------+
793 800 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
794 801 +--------------------+---------------------+
795 802 |CSI | Enabled (see USAGE) |
796 803 +--------------------+---------------------+
797 804 |Interface Stability | Committed |
798 805 +--------------------+---------------------+
799 806 |Standard | See standards(5). |
800 807 +--------------------+---------------------+
801 808
802 809 SEE ALSO
803 810 kill(1), lgrpinfo(1), nice(1), pagesize(1), pmap(1), priocntl(1),
804 811 who(1), getty(1M), proc(4), ttysrch(4), attributes(5), environ(5),
805 812 resource_controls(5), standards(5), zones(5)
806 813
807 814 NOTES
808 815 Things can change while ps is running. The snapshot it gives is true
809 816 only for a split-second, and it might not be accurate by the time you
810 817 see it. Some data printed for defunct processes is irrelevant.
811 818
812 819
813 820 If no options to select processes are specified, ps reports all
814 821 processes associated with the controlling terminal. If there is no
815 822 controlling terminal, there is no report other than the header.
816 823
↓ open down ↓ |
86 lines elided |
↑ open up ↑ |
817 824
818 825 ps -ef or ps -o stime might not report the actual start of a tty login
819 826 session, but rather an earlier time, when a getty was last respawned on
820 827 the tty line.
821 828
822 829
823 830 ps is CSI-enabled except for login names (usernames).
824 831
825 832
826 833
827 - June 13, 2017 PS(1)
834 + August 22, 2018 PS(1)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX