1ps(1)                            User Commands                           ps(1)
2
3
4

NAME

6       ps - report process status
7

SYNOPSIS

9       ps [-aAcdefjHlLPyZ] [-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

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

OPTIONS

29       The following options are supported:
30
31       -a             Lists information about all  processes  most  frequently
32                      requested:  all  those  except  session leaders and pro‐
33                      cesses not associated with a terminal.
34
35
36       -A             Lists information for all processes.  Identical  to  -e,
37                      below.
38
39
40       -c             Prints  information  in a format that reflects scheduler
41                      properties as described in priocntl(1).  The  -c  option
42                      affects  the  output  of  the  -f  and  -l  options,  as
43                      described below.
44
45
46       -d             Lists information about  all  processes  except  session
47                      leaders.
48
49
50       -e             Lists information about every process now running.
51
52                      When  the -eoption is specified, options -z, -t, -u, -U,
53                      -g, -G, -p, -g, -s and -a options have no effect.
54
55
56       -f             Generates a full listing. (See below for significance of
57                      columns in a full listing.)
58
59
60       -g grplist     Lists  only  process  data  whose group leader's ID num‐
61                      ber(s) appears in grplist. (A group leader is a  process
62                      whose  process  ID  number  is  identical to its process
63                      group ID number.)
64
65
66       -G gidlist     Lists information for processes whose real group ID num‐
67                      bers  are given in gidlist. The gidlist must be a single
68                      argument in the form  of  a  blank-  or  comma-separated
69                      list.
70
71
72       -h lgrplist    Lists  only  the  processes  homed to the specified lgr‐
73                      plist. Nothing is listed for any invalid group specified
74                      in lgrplist.
75
76
77       -H             Prints  the  home  lgroup  of the process under an addi‐
78                      tional column header, LGRP.
79
80
81       -j             Prints session ID and process group ID.
82
83
84       -l             Generates a long listing. (See below.)
85
86
87       -L             Prints information about each light weight process (lwp)
88                      in each selected process. (See below.)
89
90
91       -n namelist    Specifies  the  name  of  an alternative system namelist
92                      file in place of the default. This  option  is  accepted
93                      for compatibility, but is ignored.
94
95
96       -o format      Prints information according to the format specification
97                      given in format. This is fully described in DISPLAY FOR‐
98                      MATS.  Multiple  -o options can be specified; the format
99                      specification is interpreted as the space-character-sep‐
100                      arated concatenation of all the format option-arguments.
101
102
103       -p proclist    Lists  only  process  data  whose process ID numbers are
104                      given in proclist.
105
106
107       -P             Prints the number of the processor to which the  process
108                      or  lwp  is  bound,  if  any, under an additional column
109                      header, PSR.
110
111
112       -s sidlist     Lists information  on  all  session  leaders  whose  IDs
113                      appear in sidlist.
114
115
116       -t term        Lists  only  process data associated with term. Terminal
117                      identifiers are specified as a device file name, and  an
118                      identifier. For example, term/a, or pts/0.
119
120
121       -u uidlist     Lists  only  process data whose effective user ID number
122                      or login name is given in uidlist. In the  listing,  the
123                      numerical  user  ID  is  printed  unless you give the -f
124                      option, which prints the login name.
125
126
127       -U uidlist     Lists information for processes whose real user ID  num‐
128                      bers  or  login  names are given in uidlist. The uidlist
129                      must be a single argument in the form  of  a  blank-  or
130                      comma-separated list.
131
132
133       -y             Under a long listing (-l), omits the obsolete F and ADDR
134                      columns and includes an RSS column to report  the  resi‐
135                      dent  set size of the process. Under the -y option, both
136                      RSS and SZ (see below) is reported in units of kilobytes
137                      instead of pages.
138
139
140       -z zonelist    Lists  only  processes in the specified zones. Zones can
141                      be specified either by name or ID. This option  is  only
142                      useful when executed in the global zone.
143
144
145       -Z             Prints  the  name  of the zone with which the process is
146                      associated under an additional column header, ZONE.  The
147                      ZONE column width is limited to 8 characters. Use ps -eZ
148                      for a quick way to see information about  every  process
149                      now running along with the associated zone name. Use
150
151                        ps -eo zone,uid,pid,ppid,time,comm,...
152
153
154                      to see zone names wider than 8 characters.
155
156
157
158       Many  of the options shown are used to select processes to list. If any
159       are specified, the default list is ignored and ps selects the processes
160       represented by the inclusive OR of all the selection-criteria options.
161

DISPLAY FORMATS

163       Under  the  -f option, ps tries to determine the command name and argu‐
164       ments given when the process was created by examining the  user  block.
165       Failing  this,  the  command name is printed, as it would have appeared
166       without the -f option, in square brackets.
167
168
169       The column headings and the meaning of the columns in a ps listing  are
170       given  below;  the  letters  f and l indicate the option (full or long,
171       respectively) that causes the  corresponding  heading  to  appear;  all
172       means  that  the heading always appears. Note: These two options deter‐
173       mine only what information is provided  for  a  process;  they  do  not
174       determine which processes are listed.
175
176       F(l)          Flags  (hexadecimal  and  additive)  associated  with the
177                     process. These flags are available  for  historical  pur‐
178                     poses; no meaning should be currently ascribed to them.
179
180
181       S (l)         The state of the process:
182
183                     O    Process is running on a processor.
184
185
186                     S    Sleeping:  process  is  waiting for an event to com‐
187                          plete.
188
189
190                     R    Runnable: process is on run queue.
191
192
193                     T    Process is stopped, either by a job  control  signal
194                          or because it is being traced.
195
196
197                     W    Waiting: process is waiting for CPU usage to drop to
198                          the CPU-caps enforced limits.
199
200
201                     Z    Zombie state:  process  terminated  and  parent  not
202                          waiting.
203
204
205
206       UID (f,l)     The  effective  user  ID number of the process (the login
207                     name is printed under the -f option).
208
209
210       PID(all)      The process ID of the process (this datum is necessary in
211                     order to kill a process).
212
213
214       PPID(f,l)     The process ID of the parent process.
215
216
217       C(f,l)        Processor  utilization  for  scheduling  (obsolete).  Not
218                     printed when the -c option is used.
219
220
221       CLS(f,l)      Scheduling class. Printed only  when  the  -c  option  is
222                     used.
223
224
225       PRI(l)        The  priority  of  the  process.  Without  the -c option,
226                     higher numbers mean lower priority. With the  -c  option,
227                     higher numbers mean higher priority.
228
229
230       NI(l)         Nice  value,  used  in  priority computation. Not printed
231                     when the -c option is used. Only processes in the certain
232                     scheduling classes have a nice value.
233
234
235       ADDR(l)       The memory address of the process.
236
237
238       SZ(l)         The  total size of the process in virtual memory, includ‐
239                     ing all mapped files and devices,  in  pages.  See  page‐
240                     size(1).
241
242
243       WCHAN(l)      The address of an event for which the process is sleeping
244                     (if blank, the process is running).
245
246
247       STIME(f)      The starting time of the process, given  in  hours,  min‐
248                     utes, and seconds. (A process begun more than twenty-four
249                     hours before the ps  inquiry  is  executed  is  given  in
250                     months and days.)
251
252
253       TTY(all)      The controlling terminal for the process (the message, ?,
254                     is printed when there is no controlling terminal).
255
256
257       TIME(all)     The cumulative execution time for the process.
258
259
260       LTIME(all)    The execution time for the lwp being reported.
261
262
263       CMD(all)      The command name (the full command  name  and  its  argu‐
264                     ments,  up to a limit of 80 characters, are printed under
265                     the -f option).
266
267
268
269       The following two additional columns are printed when the -j option  is
270       specified:
271
272       PGID    The process ID of the process group leader.
273
274
275       SID     The process ID of the session leader.
276
277
278
279       The  following two additional columns are printed when the -L option is
280       specified:
281
282       LWP     The lwp ID of the lwp being reported.
283
284
285       NLWP    The number of lwps in the process (if -f is also specified).
286
287
288
289       Under the -L option, one line is printed for each lwp  in  the  process
290       and  the  time-reporting fields STIME and LTIME show the values for the
291       lwp, not the process. A traditional  single-threaded  process  contains
292       only one lwp.
293
294
295       A process that has exited and has a parent, but has not yet been waited
296       for by the parent, is marked <defunct>.
297
298   -o format
299       The -o option allows the output format to be specified under user  con‐
300       trol.
301
302
303       The  format specification must be a list of names presented as a single
304       argument, blank-  or  comma-separated.  Each  variable  has  a  default
305       header.  The  default  header  can be overridden by appending an equals
306       sign and the new text of the header. The rest of the characters in  the
307       argument  is  used as the header text. The fields specified are written
308       in the order specified on the command line, and should be  arranged  in
309       columns  in  the output. The field widths are selected by the system to
310       be at least as wide as the header text (default or  overridden  value).
311       If  the  header  text  is null, such as -o user=, the field width is at
312       least as wide as the default header text. If all header text fields are
313       null, no header line is written.
314
315
316       The following names are recognized in the POSIX locale:
317
318       user      The  effective  user  ID  of the process. This is the textual
319                 user ID, if it can be obtained and the field  width  permits,
320                 or a decimal representation otherwise.
321
322
323       ruser     The real user ID of the process. This is the textual user ID,
324                 if it can be obtained and the field width permits, or a deci‐
325                 mal representation otherwise.
326
327
328       group     The  effective  group  ID of the process. This is the textual
329                 group ID, if it can be obtained and the field width  permits,
330                 or a decimal representation otherwise.
331
332
333       rgroup    The  real  group ID of the process. This is the textual group
334                 ID, if it can be obtained and the field width permits,  or  a
335                 decimal representation otherwise.
336
337
338       pid       The decimal value of the process ID.
339
340
341       ppid      The decimal value of the parent process ID.
342
343
344       pgid      The decimal value of the process group ID.
345
346
347       pcpu      The  ratio of CPU time used recently to CPU time available in
348                 the same period, expressed as a percentage.  The  meaning  of
349                 ``recently''  in  this  context  is unspecified. The CPU time
350                 available is determined in an unspecified manner.
351
352
353       vsz       The total size of the process in  virtual  memory,  in  kilo‐
354                 bytes.
355
356
357       nice      The  decimal  value  of the system scheduling priority of the
358                 process. See nice(1).
359
360
361       etime     In the POSIX locale, the elapsed time since the  process  was
362                 started, in the form:
363
364                 [[dd-]hh:]mm:ss
365
366                 where
367
368                 dd    is the number of days
369
370
371                 hh    is the number of hours
372
373
374                 mm    is the number of minutes
375
376
377                 ss    is the number of seconds
378
379                 The  dd  field is a decimal integer. The hh, mm and ss fields
380                 is two-digit decimal integers padded on the left with zeros.
381
382
383       time      In the POSIX locale, the cumulative CPU time of  the  process
384                 in the form:
385
386                 [dd-]hh:mm:ss
387
388                 The  dd,  hh,  mm, and ss fields is as described in the etime
389                 specifier.
390
391
392       tty       The name of the controlling terminal of the process (if  any)
393                 in the same format used by the who(1) command.
394
395
396       comm      The  name  of the command being executed (argv[0] value) as a
397                 string.
398
399
400       args      The command with all its arguments as a string. The implemen‐
401                 tation  might  truncate  this value to the field width; it is
402                 implementation-dependent  whether  any   further   truncation
403                 occurs. It is unspecified whether the string represented is a
404                 version of the argument list as it was passed to the  command
405                 when  it  started,  or  is a version of the arguments as they
406                 might have been modified  by  the  application.  Applications
407                 cannot depend on being able to modify their argument list and
408                 having that modification be reflected in the  output  of  ps.
409                 The Solaris implementation limits the string to 80 bytes; the
410                 string is the version of the argument list as it  was  passed
411                 to the command when it started.
412
413
414
415       The following names are recognized in the Solaris implementation:
416
417       f          Flags   (hexadecimal   and  additive)  associated  with  the
418                  process.
419
420
421       s          The state of the process.
422
423
424       c          Processor utilization for scheduling (obsolete).
425
426
427       uid        The effective user ID number of the  process  as  a  decimal
428                  integer.
429
430
431       ruid       The real user ID number of the process as a decimal integer.
432
433
434       gid        The  effective  group  ID number of the process as a decimal
435                  integer.
436
437
438       rgid       The real group ID number of the process as a  decimal  inte‐
439                  ger.
440
441
442       projid     The project ID number of the process as a decimal integer.
443
444
445       project    The  project  ID  of  the process as a textual value if that
446                  value can be obtained; otherwise, as a decimal integer.
447
448
449       zoneid     The zone ID number of the process as a decimal integer.
450
451
452       zone       The zone ID of the process as a textual value if that  value
453                  can be obtained; otherwise, as a decimal integer.
454
455
456       sid        The process ID of the session leader.
457
458
459       taskid     The task ID of the process.
460
461
462       class      The scheduling class of the process.
463
464
465       pri        The priority of the process. Higher numbers mean higher pri‐
466                  ority.
467
468
469       opri       The obsolete priority of the  process.  Lower  numbers  mean
470                  higher priority.
471
472
473       lwp        The  decimal value of the lwp ID. Requesting this formatting
474                  option causes one line to be printed for  each  lwp  in  the
475                  process.
476
477
478       nlwp       The number of lwps in the process.
479
480
481       psr        The  number  of the processor to which the process or lwp is
482                  bound.
483
484
485       pset       The ID of the processor set to which the process or  lwp  is
486                  bound.
487
488
489       addr       The memory address of the process.
490
491
492       osz        The total size of the process in virtual memory, in pages.
493
494
495       wchan      The  address  of  an event for which the process is sleeping
496                  (if −, the process is running).
497
498
499       stime      The starting time or date of the process,  printed  with  no
500                  blanks.
501
502
503       rss        The  resident set size of the process, in kilobytes. The rss
504                  value reported by ps is an estimate provided by proc(4) that
505                  might  underestimate the actual resident set size. Users who
506                  wish to get more accurate  usage  information  for  capacity
507                  planning should use pmap(1) -x instead.
508
509
510       pmem       The ratio of the process's resident set size to the physical
511                  memory on the machine, expressed as a percentage.
512
513
514       fname      The first 8 bytes of the base name  of  the  process's  exe‐
515                  cutable file.
516
517
518       ctid       The  contract  ID  of  the process contract the process is a
519                  member of as a decimal integer.
520
521
522       lgrp       The home lgroup of the process.
523
524
525
526       Only comm and args are allowed to contain blank characters; all others,
527       including the Solaris implementation variables, are not.
528
529
530       The  following  table  specifies  the  default header to be used in the
531       POSIX locale corresponding to each format specifier.
532
533
534
535
536       ┌─────────────────────────────────────────────────────────────────┐
537       │    Format          Default          Format          Default     │
538       │  Specifier          Header         Specifier         Header     │
539       ├─────────────────────────────────────────────────────────────────┤
540       │     args           COMMAND           ppid             PPID      │
541       │     comm           COMMAND          rgroup           RGROUP     │
542       │    etime           ELAPSED           ruser           RUSER      │
543       │    group            GROUP            time             TIME      │
544       │     nice              NI              tty              TT       │
545       │     pcpu             %CPU            user             USER      │
546       │     pgid             PGID             vsz             VSZ       │
547       │     pid              PID                                        │
548       └─────────────────────────────────────────────────────────────────┘
549
550
551       The following table lists the Solaris implementation format  specifiers
552       and the default header used with each.
553
554
555
556
557       ┌─────────────────────────────────────────────────────────────────┐
558       │    Format          Default          Format          Default     │
559       │  Specifier          Header         Specifier         Header     │
560       ├─────────────────────────────────────────────────────────────────┤
561       │     addr             ADDR           projid           PROJID     │
562       │      c                C             project         PROJECT     │
563       │    class             CLS              psr             PSR       │
564       │      f                F              rgid             RGID      │
565       │    fname           COMMAND            rss             RSS       │
566       │     gid              GID             ruid             RUID      │
567       │     lgrp             LGRP              s               S        │
568       │     lwp              LWP              sid             SID       │
569       │     nlwp             NLWP            stime           STIME      │
570       │     opri             PRI            taskid           TASKID     │
571       │     osz               SZ              uid             UID       │
572       │     pmem             %MEM            wchan           WCHAN      │
573       │     pri              PRI             zone             ZONE      │
574       │     ctid             CTID           zoneid           ZONEID     │
575       └─────────────────────────────────────────────────────────────────┘
576

EXAMPLES

578       Example 1 Using ps Command
579
580
581       The command:
582
583
584         example% ps -o user,pid,ppid=MOM -o args
585
586
587
588
589       writes the following in the POSIX locale:
590
591
592          USER  PID   MOM   COMMAND
593         helene  34    12   ps -o uid,pid,ppid=MOM -o args
594
595
596
597
598       The  contents of the COMMAND field need not be the same due to possible
599       truncation.
600
601

ENVIRONMENT VARIABLES

603       See environ(5) for descriptions of the following environment  variables
604       that  affect  the execution of ps: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES,
605       LC_TIME, and NLSPATH.
606
607       COLUMNS    Override the system-selected horizontal screen size, used to
608                  determine the number of text columns to display.
609
610

EXIT STATUS

612       The following exit values are returned:
613
614       0     Successful completion.
615
616
617       >0    An error occurred.
618
619

FILES

621       /dev/pts/*
622
623
624       /dev/term/*    terminal (``tty'') names searcher files
625
626
627       /etc/passwd    UID information supplier
628
629
630       /proc/*        process control files
631
632

ATTRIBUTES

634       See attributes(5) for descriptions of the following attributes:
635
636
637
638
639       ┌─────────────────────────────┬─────────────────────────────┐
640       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
641       ├─────────────────────────────┼─────────────────────────────┤
642       │Availability                 │SUNWcsu                      │
643       ├─────────────────────────────┼─────────────────────────────┤
644       │CSI                          │Enabled (see USAGE)          │
645       ├─────────────────────────────┼─────────────────────────────┤
646       │Interface Stability          │Committed                    │
647       ├─────────────────────────────┼─────────────────────────────┤
648       │Standard                     │See standards(5).            │
649       └─────────────────────────────┴─────────────────────────────┘
650

SEE ALSO

652       kill(1),   lgrpinfo(1),  nice(1),  pagesize(1),  pmap(1),  priocntl(1),
653       who(1),  getty(1M),  proc(4),  ttysrch(4),  attributes(5),  environ(5),
654       resource_controls(5), standards(5), zones(5)
655

NOTES

657       Things  can  change  while ps is running. The snapshot it gives is true
658       only for a split-second, and it might not be accurate by the  time  you
659       see it. Some data printed for defunct processes is irrelevant.
660
661
662       If  no  options  to select processes are specified, ps reports all pro‐
663       cesses associated with the controlling terminal. If there  is  no  con‐
664       trolling terminal, there is no report other than the header.
665
666
667       ps  -ef or ps -o stime might not report the actual start of a tty login
668       session, but rather an earlier time, when a getty was last respawned on
669       the tty line.
670
671
672       ps is CSI-enabled except for login names (usernames).
673
674
675
676SunOS 5.11                        16 Aug 2009                            ps(1)
Impressum