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