summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/ps.1
blob: ccce0d658ba8fd83b828f24a84df687849e72e5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
.\"
.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
.\" permission to reproduce portions of its copyrighted documentation.
.\" Original documentation from The Open Group can be obtained online at
.\" http://www.opengroup.org/bookstore/.
.\"
.\" The Institute of Electrical and Electronics Engineers and The Open
.\" Group, have given us permission to reprint portions of their
.\" documentation.
.\"
.\" In the following statement, the phrase ``this text'' refers to portions
.\" of the system documentation.
.\"
.\" Portions of this text are reprinted and reproduced in electronic form
.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
.\" Standard for Information Technology -- Portable Operating System
.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
.\" Engineers, Inc and The Open Group.  In the event of any discrepancy
.\" between these versions and the original IEEE and The Open Group
.\" Standard, the original IEEE and The Open Group Standard is the referee
.\" document.  The original Standard can be obtained online at
.\" http://www.opengroup.org/unix/online.html.
.\"
.\" This notice shall appear on any product containing this material.
.\"
.\" The contents of this file are subject to the terms of the
.\" Common Development and Distribution License (the "License").
.\" You may not use this file except in compliance with the License.
.\"
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
.\" or http://www.opensolaris.org/os/licensing.
.\" See the License for the specific language governing permissions
.\" and limitations under the License.
.\"
.\" When distributing Covered Code, include this CDDL HEADER in each
.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
.\" If applicable, add the following below this CDDL HEADER, with the
.\" fields enclosed by brackets "[]" replaced with your own identifying
.\" information: Portions Copyright [yyyy] [name of copyright owner]
.\"
.\"
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
.\" Copyright (c) 2013 Gary Mills
.\" Copyright 2019 Joyent, Inc.
.\"
.TH PS 1 "August 28, 2019"
.SH NAME
ps \- report process status
.SH SYNOPSIS
.nf
\fBps\fR [\fB-aAcdefjHlLPWyZ\fR] [\fB-g\fR \fIgrplist\fR] [\fB-h\fR \fIlgrplist\fR]
     [\fB-n\fR \fInamelist\fR] [\fB-o\fR \fIformat\fR]... [\fB-p\fR \fIproclist\fR]
     [\fB-s\fR \fIsidlist\fR] [\fB-t\fR \fIterm\fR] [\fB-u\fR \fIuidlist\fR] [\fB-U\fR \fIuidlist\fR]
     [\fB-G\fR \fIgidlist\fR] [\fB-z\fR \fIzonelist\fR]
.fi

.SH DESCRIPTION
The \fBps\fR command prints information about active processes. Without
options, \fBps\fR prints information about processes that have the same
effective user \fBID\fR and the same controlling terminal as the invoker. The
output contains only the process \fBID\fR, terminal identifier, cumulative
execution time, and the command name. Otherwise, the information that is
displayed is controlled by the options.
.sp
.LP
Some options accept lists as arguments. Items in a list can be either separated
by commas or else enclosed in quotes and separated by commas or spaces. Values
for \fIproclist\fR and \fIgrplist\fR must be numeric.
.sp
.LP
The \fBps\fR command also accepts BSD-style options.  See \fBps\fR(1b).
.SH OPTIONS
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 15n
Lists information about \fBa\fRll processes most frequently requested: all
those except session leaders and processes not associated with a terminal.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-A\fR\fR
.ad
.RS 15n
Lists information for all processes. Identical to \fB-e\fR, below.
.RE

.sp
.ne 2
.na
\fB\fB-c\fR\fR
.ad
.RS 15n
Prints information in a format that reflects scheduler properties as described
in \fBpriocntl\fR(1). The \fB-c\fR option affects the output of the \fB-f\fR
and \fB-l\fR options, as described below.
.RE

.sp
.ne 2
.na
\fB\fB-d\fR\fR
.ad
.RS 15n
Lists information about all processes except session leaders.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR\fR
.ad
.RS 15n
Lists information about \fBe\fRvery process now running.
.sp
When the \fB-e\fR option is specified, options \fB-z\fR, \fB-t\fR, \fB-u\fR,
\fB-U\fR, \fB-g\fR, \fB-G\fR, \fB-p\fR, \fB-h\fR, \fB-s\fR and \fB-a\fR
have no effect.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 15n
Generates a \fBf\fRull listing. (See below for significance of columns in a
full listing.)
.RE

.sp
.ne 2
.na
\fB\fB-g\fR \fIgrplist\fR\fR
.ad
.RS 15n
Lists only process data whose group leader's \fBID\fR number(s) appears in
\fIgrplist\fR. (A group leader is a process whose process \fBID\fR number is
identical to its process group \fBID\fR number.)
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-G\fR \fIgidlist\fR\fR
.ad
.RS 15n
Lists information for processes whose real group ID numbers are given in
\fIgidlist\fR. The \fIgidlist\fR must be a single argument in the form of a
blank- or comma-separated list.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-h\fR \fIlgrplist\fR\fR
.ad
.RS 15n
Lists only the processes homed to the specified \fIlgrplist\fR. Nothing is
listed for any invalid group specified in \fIlgrplist\fR.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-H\fR\fR
.ad
.RS 15n
Prints the home lgroup of the process under an additional column header, LGRP.
.RE

.sp
.ne 2
.na
\fB\fB-j\fR\fR
.ad
.RS 15n
Prints session \fBID\fR and process group \fBID\fR.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 15n
Generates a \fBl\fRong listing. (See below.)
.RE

.sp
.ne 2
.na
\fB\fB-L\fR\fR
.ad
.RS 15n
Prints information about each light weight process (\fIlwp\fR) in each selected
process. (See below.)
.RE

.sp
.ne 2
.na
\fB\fB-n\fR \fInamelist\fR\fR
.ad
.RS 15n
Specifies the name of an alternative system \fInamelist\fR file in place of the
default. This option is accepted for compatibility, but is ignored.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIformat\fR\fR
.ad
.RS 15n
Prints information according to the format specification given in \fIformat\fR.
This is fully described in \fBDISPLAY FORMATS\fR. Multiple \fB-o\fR options can
be specified; the format specification is interpreted as the
space-character-separated concatenation of all the \fIformat\fR
option-arguments.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIproclist\fR\fR
.ad
.RS 15n
Lists only process data whose process \fBID\fR numbers are given in
\fIproclist\fR.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-P\fR\fR
.ad
.RS 15n
Prints the number of the processor to which the process or lwp is bound, if
any, under an additional column header, \fBPSR\fR.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR \fIsidlist\fR\fR
.ad
.RS 15n
Lists information on all session leaders whose \fBID\fRs appear in
\fIsidlist\fR.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR \fIterm\fR\fR
.ad
.RS 15n
Lists only process data associated with \fIterm\fR. Terminal identifiers are
specified as a device file name, and an identifier. For example, \fBterm/a\fR,
or \fBpts/0\fR.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-u\fR \fIuidlist\fR\fR
.ad
.RS 15n
Lists only process data whose effective user \fBID\fR number or login name is
given in \fIuidlist\fR. In the listing, the numerical user \fBID\fR is printed
unless you give the \fB-f\fR option, which prints the login name.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-U\fR \fIuidlist\fR\fR
.ad
.RS 15n
Lists information for processes whose real user \fBID\fR numbers or login names
are given in \fIuidlist\fR. The \fIuidlist\fR must be a single argument in the
form of a blank- or comma-separated list.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-W\fR\fR
.ad
.RS 15n
Truncate long names even when \fBps\fR would normally print them
in full.
A trailing asterisk marks a long name that has been truncated
to fit the column.
.RE

.sp
.ne 2
.na
\fB\fB-y\fR\fR
.ad
.RS 15n
Under a long listing (\fB-l\fR), omits the obsolete \fBF\fR and \fBADDR\fR
columns and includes an \fBRSS\fR column to report the resident set size of the
process. Under the \fB-y\fR option, both \fBRSS\fR and \fBSZ\fR (see below) is
reported in units of kilobytes instead of pages.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR \fIzonelist\fR\fR
.ad
.RS 15n
Lists only processes in the specified zones. Zones can be specified either by
name or ID. This option is only useful when executed in the global zone.
.sp
This option is ignored when the \fB-e\fR option is also specified.
.RE

.sp
.ne 2
.na
\fB\fB-Z\fR\fR
.ad
.RS 15n
Prints the name of the zone with which the process is associated under an
additional column header, \fBZONE\fR. The \fBZONE\fR column width is limited to
8 characters. Use \fBps\fR \fB-eZ\fR for a quick way to see information about
every process now running along with the associated zone name. Use
.sp
.in +2
.nf
ps -eo zone,uid,pid,ppid,time,comm,...
.fi
.in -2
.sp

to see zone names wider than 8 characters.
.RE

.sp
.LP
Many of the options shown are used to select processes to list. If any are
specified, the default list is ignored and \fBps\fR selects the processes
represented by the inclusive OR of all the selection-criteria options.
.SH DISPLAY FORMATS
Under the \fB-f\fR option, \fBps\fR uses the \fB\fB/proc/\fInnnnn\fR\fB/cmdline\fR\fR
file to read the full process arguments. The process may have changed these
since it was started.
Failing this, the command name is printed, as it would have appeared without
the \fB-f\fR option, in square brackets.
.sp
.LP
The column headings and the meaning of the columns in a \fBps\fR listing are
given below; the letters \fBf\fR and \fBl\fR indicate the option (f\fBull\fR or
\fBl\fRong, respectively) that causes the corresponding heading to appear;
\fBall\fR means that the heading always appears. \fBNote:\fR These two options
determine only what information is provided for a process; they do not
determine which processes are listed.
.sp
.ne 2
.na
\fB\fBF\fR(l)\fR
.ad
.RS 14n
Flags (hexadecimal and additive) associated with the process. These flags are
available for historical purposes; no meaning should be currently ascribed to
them.
.RE

.sp
.ne 2
.na
\fB\fBS\fR (l)\fR
.ad
.RS 14n
The state of the process:
.sp
.ne 2
.na
\fBO\fR
.ad
.RS 5n
Process is running on a processor.
.RE

.sp
.ne 2
.na
\fBS\fR
.ad
.RS 5n
Sleeping: process is waiting for an event to complete.
.RE

.sp
.ne 2
.na
\fBR\fR
.ad
.RS 5n
Runnable: process is on run queue.
.RE

.sp
.ne 2
.na
\fBT\fR
.ad
.RS 5n
Process is stopped, either by a job control signal or because it is being
traced.
.RE

.sp
.ne 2
.na
\fBW\fR
.ad
.RS 5n
Waiting: process is waiting for CPU usage to drop to the CPU-caps enforced
limits.
.RE

.sp
.ne 2
.na
\fBZ\fR
.ad
.RS 5n
Zombie state: process terminated and parent not waiting.
.RE

.RE

.sp
.ne 2
.na
\fB\fBUID\fR (f,l)\fR
.ad
.RS 14n
The effective user \fBID\fR number of the process (the login name is printed
under the \fB-f\fR option).
A trailing asterisk marks a long name that has been truncated
to fit the column.
.RE

.sp
.ne 2
.na
\fB\fBPID\fR(all)\fR
.ad
.RS 14n
The process \fBID\fR of the process (this datum is necessary in order to kill a
process).
.RE

.sp
.ne 2
.na
\fB\fBPPID\fR(f,l)\fR
.ad
.RS 14n
The process \fBID\fR of the parent process.
.RE

.sp
.ne 2
.na
\fB\fBC\fR(f,l)\fR
.ad
.RS 14n
Processor utilization for scheduling (obsolete). Not printed when the \fB-c\fR
option is used.
.RE

.sp
.ne 2
.na
\fB\fBCLS\fR(f,l)\fR
.ad
.RS 14n
Scheduling class. Printed only when the \fB-c\fR option is used.
.RE

.sp
.ne 2
.na
\fB\fBPRI\fR(l)\fR
.ad
.RS 14n
The priority of the process. Without the \fB-c\fR option, higher numbers mean
lower priority. With the \fB-c\fR option, higher numbers mean higher priority.
.RE

.sp
.ne 2
.na
\fB\fBNI\fR(l)\fR
.ad
.RS 14n
Nice value, used in priority computation. Not printed when the \fB-c\fR option
is used. Only processes in the certain scheduling classes have a nice value.
.RE

.sp
.ne 2
.na
\fB\fBADDR\fR(l)\fR
.ad
.RS 14n
The memory address of the process.
.RE

.sp
.ne 2
.na
\fB\fBSZ\fR(l)\fR
.ad
.RS 14n
The total size of the process in virtual memory, including all mapped files and
devices, in pages. See \fBpagesize\fR(1).
.RE

.sp
.ne 2
.na
\fB\fBWCHAN\fR(l)\fR
.ad
.RS 14n
The address of an event for which the process is sleeping (if blank, the
process is running).
.RE

.sp
.ne 2
.na
\fB\fBSTIME\fR(f)\fR
.ad
.RS 14n
The starting time of the process, given in hours, minutes, and seconds. (A
process begun more than twenty-four hours before the \fBps\fR inquiry is
executed is given in months and days.)
.RE

.sp
.ne 2
.na
\fB\fBTTY\fR(all)\fR
.ad
.RS 14n
The controlling terminal for the process (the message, \fB?\fR, is printed when
there is no controlling terminal).
.RE

.sp
.ne 2
.na
\fB\fBTIME\fR(all)\fR
.ad
.RS 14n
The cumulative execution time for the process.
.RE

.sp
.ne 2
.na
\fB\fBLTIME\fR(all)\fR
.ad
.RS 14n
The execution time for the lwp being reported.
.RE

.sp
.ne 2
.na
\fB\fBCMD\fR(all)\fR
.ad
.RS 14n
The command name (or, with the \fB-f\fR option, the full current process
arguments).
.RE

.sp
.LP
The following two additional columns are printed when the \fB-j\fR option is
specified:
.sp
.ne 2
.na
\fB\fBPGID\fR\fR
.ad
.RS 8n
The process ID of the process group leader.
.RE

.sp
.ne 2
.na
\fB\fBSID\fR\fR
.ad
.RS 8n
The process ID of the session leader.
.RE

.sp
.LP
The following two additional columns are printed when the \fB-L\fR option is
specified:
.sp
.ne 2
.na
\fB\fBLWP\fR\fR
.ad
.RS 8n
The lwp ID of the lwp being reported.
.RE

.sp
.ne 2
.na
\fB\fBNLWP\fR\fR
.ad
.RS 8n
The number of lwps in the process (if \fB-f\fR is also specified).
.RE

.sp
.LP
Under the \fB-L\fR option, one line is printed for each lwp in the process and
the time-reporting fields \fBSTIME\fR and \fBLTIME\fR show the values for the
lwp, not the process. A traditional single-threaded process contains only one
lwp.
.sp
.LP
A process that has exited and has a parent, but has not yet been waited for by
the parent, is marked \fB<defunct>\fR\&.
.SS "\fB-o\fR format"
The \fB-o\fR option allows the output format to be specified under user
control.
.sp
.LP
The format specification must be a list of names presented as a single
argument, blank- or comma-separated. Each variable has a default header. The
default header can be overridden by appending an equals sign and the new text
of the header. The rest of the characters in the argument is used as the header
text. The fields specified are written in the order specified on the command
line, and should be arranged in columns in the output. The field widths are
selected by the system to be at least as wide as the header text (default or
overridden value). If the header text is null, such as \fB-o\fR \fIuser=,\fR
the field width is at least as wide as the default header text.
Long names are not truncated in this mode.
If all header text fields are null, no header line is written.
.sp
.LP
The following names are recognized in the POSIX locale:
.sp
.ne 2
.na
\fB\fBuser\fR\fR
.ad
.RS 10n
The effective user \fBID\fR of the process. This is the textual user \fBID\fR,
if it can be obtained and the field width permits, or a decimal representation
otherwise.
.RE

.sp
.ne 2
.na
\fB\fBruser\fR\fR
.ad
.RS 10n
The real user \fBID\fR of the process. This is the textual user \fBID\fR, if it
can be obtained and the field width permits, or a decimal representation
otherwise.
.RE

.sp
.ne 2
.na
\fB\fBgroup\fR\fR
.ad
.RS 10n
The effective group \fBID\fR of the process. This is the textual group
\fBID,\fR if it can be obtained and the field width permits, or a decimal
representation otherwise.
.RE

.sp
.ne 2
.na
\fB\fBrgroup\fR\fR
.ad
.RS 10n
The real group \fBID\fR of the process. This is the textual group \fBID,\fR if
it can be obtained and the field width permits, or a decimal representation
otherwise.
.RE

.sp
.ne 2
.na
\fB\fBpid\fR\fR
.ad
.RS 10n
The decimal value of the process \fBID\fR.
.RE

.sp
.ne 2
.na
\fB\fBppid\fR\fR
.ad
.RS 10n
The decimal value of the parent process \fBID\fR.
.RE

.sp
.ne 2
.na
\fB\fBpgid\fR\fR
.ad
.RS 10n
The decimal value of the process group \fBID.\fR
.RE

.sp
.ne 2
.na
\fB\fBpcpu\fR\fR
.ad
.RS 10n
The ratio of CPU time used recently to CPU time available in the same period,
expressed as a percentage. The meaning of ``recently'' in this context is
unspecified. The CPU time available is determined in an unspecified manner.
.RE

.sp
.ne 2
.na
\fB\fBvsz\fR\fR
.ad
.RS 10n
The total size of the process in virtual memory, in kilobytes.
.RE

.sp
.ne 2
.na
\fB\fBnice\fR\fR
.ad
.RS 10n
The decimal value of the system scheduling priority of the process. See
\fBnice\fR(1).
.RE

.sp
.ne 2
.na
\fB\fBetime\fR\fR
.ad
.RS 10n
In the POSIX locale, the elapsed time since the process was started, in the
form:
.sp
\fB[[\fR\fIdd\fR-\fB]\fR\fIhh\fR:\fB]\fR\fImm\fR:\fIss\fR
.sp
where
.sp
.ne 2
.na
\fB\fIdd\fR\fR
.ad
.RS 6n
is the number of days
.RE

.sp
.ne 2
.na
\fB\fIhh\fR\fR
.ad
.RS 6n
is the number of hours
.RE

.sp
.ne 2
.na
\fB\fImm\fR\fR
.ad
.RS 6n
is the number of minutes
.RE

.sp
.ne 2
.na
\fB\fIss\fR\fR
.ad
.RS 6n
is the number of seconds
.RE

The \fIdd\fR field is a decimal integer. The \fIhh\fR, \fImm\fR and \fIss\fR
fields is two-digit decimal integers padded on the left with zeros.
.RE

.sp
.ne 2
.na
\fB\fBtime\fR\fR
.ad
.RS 10n
In the POSIX locale, the cumulative CPU time of the process in the form:
.sp
\fB[\fR\fIdd\fR-\fB]\fR\fIhh\fR:\fImm\fR:\fIss\fR
.sp
The \fIdd\fR, \fIhh\fR, \fImm\fR, and \fIss\fR fields is as described in the
\fBetime\fR specifier.
.RE

.sp
.ne 2
.na
\fB\fBtty\fR\fR
.ad
.RS 10n
The name of the controlling terminal of the process (if any) in the same format
used by the \fBwho\fR(1) command.
.RE

.sp
.ne 2
.na
\fB\fBcomm\fR\fR
.ad
.RS 10n
The name of the command being executed (\fBargv[0]\fR value) as a string.
.RE

.sp
.ne 2
.na
\fB\fBargs\fR\fR
.ad
.RS 10n
The command with all its arguments as a string. The implementation might
truncate this value to the field width; it is implementation-dependent whether
any further truncation occurs. It is unspecified whether the string represented
is a version of the argument list as it was passed to the command when it
started, or is a version of the arguments as they might have been modified by
the application. Applications cannot depend on being able to modify their
argument list and having that modification be reflected in the output of
\fBps\fR. However, the current implementation will display the full modified
process arguments when given the \fB-f\fR argument; otherwise this is the
initial process arguments, but limited to 80 bytes.
.RE

.sp
.LP
The following names are recognized in the illumos implementation:
.sp
.ne 2
.na
\fB\fBf\fR\fR
.ad
.RS 11n
Flags (hexadecimal and additive) associated with the process.
.RE

.sp
.ne 2
.na
\fB\fBs\fR\fR
.ad
.RS 11n
The state of the process.
.RE

.sp
.ne 2
.na
\fB\fBc\fR\fR
.ad
.RS 11n
Processor utilization for scheduling (obsolete).
.RE

.sp
.ne 2
.na
\fB\fBuid\fR\fR
.ad
.RS 11n
The effective user \fBID\fR number of the process as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBruid\fR\fR
.ad
.RS 11n
The real user \fBID\fR number of the process as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBgid\fR\fR
.ad
.RS 11n
The effective group \fBID\fR number of the process as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBrgid\fR\fR
.ad
.RS 11n
The real group \fBID\fR number of the process as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBprojid\fR\fR
.ad
.RS 11n
The project \fBID\fR number of the process as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBproject\fR\fR
.ad
.RS 11n
The project \fBID\fR of the process as a textual value if that value can be
obtained; otherwise, as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBzoneid\fR\fR
.ad
.RS 11n
The zone \fBID\fR number of the process as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBzone\fR\fR
.ad
.RS 11n
The zone \fBID\fR of the process as a textual value if that value can be
obtained; otherwise, as a decimal integer.
.RE

.sp
.ne 2
.na
\fB\fBsid\fR\fR
.ad
.RS 11n
The process ID of the session leader.
.RE

.sp
.ne 2
.na
\fB\fBtaskid\fR\fR
.ad
.RS 11n
The task \fBID\fR of the process.
.RE

.sp
.ne 2
.na
\fB\fBclass\fR\fR
.ad
.RS 11n
The scheduling class of the process.
.RE

.sp
.ne 2
.na
\fB\fBpri\fR\fR
.ad
.RS 11n
The priority of the process. Higher numbers mean higher priority.
.RE

.sp
.ne 2
.na
\fB\fBopri\fR\fR
.ad
.RS 11n
The obsolete priority of the process. Lower numbers mean higher priority.
.RE

.sp
.ne 2
.na
\fB\fBlwp\fR\fR
.ad
.RS 11n
The decimal value of the lwp \fBID\fR. Requesting this formatting option causes
one line to be printed for each lwp in the process.
.RE

.sp
.ne 2
.na
\fB\fBlwpname\fR\fR
.ad
.RS 11n
The name of the lwp, if set. Requesting this formatting option causes
one line to be printed for each lwp in the process.
.RE

.sp
.ne 2
.na
\fB\fBnlwp\fR\fR
.ad
.RS 11n
The number of lwps in the process.
.RE

.sp
.ne 2
.na
\fB\fBpsr\fR\fR
.ad
.RS 11n
The number of the processor to which the process or lwp is bound.
.RE

.sp
.ne 2
.na
\fB\fBpset\fR\fR
.ad
.RS 11n
The \fBID\fR of the processor set to which the process or lwp is bound.
.RE

.sp
.ne 2
.na
\fB\fBaddr\fR\fR
.ad
.RS 11n
The memory address of the process.
.RE

.sp
.ne 2
.na
\fB\fBosz\fR\fR
.ad
.RS 11n
The total size of the process in virtual memory, in pages.
.RE

.sp
.ne 2
.na
\fB\fBwchan\fR\fR
.ad
.RS 11n
The address of an event for which the process is sleeping (if \(mi, the process
is running).
.RE

.sp
.ne 2
.na
\fB\fBstime\fR\fR
.ad
.RS 11n
The starting time or date of the process, printed with no blanks.
.RE

.sp
.ne 2
.na
\fB\fBrss\fR\fR
.ad
.RS 11n
The resident set size of the process, in kilobytes. The \fBrss\fR value
reported by \fBps\fR is an estimate provided by \fBproc\fR(4) that might
underestimate the actual resident set size. Users who wish to get more accurate
usage information for capacity planning should use \fBpmap\fR(1) \fB-x\fR
instead.
.RE

.sp
.ne 2
.na
\fB\fBpmem\fR\fR
.ad
.RS 11n
The ratio of the process's resident set size to the physical memory on the
machine, expressed as a percentage.
.RE

.sp
.ne 2
.na
\fB\fBfname\fR\fR
.ad
.RS 11n
The first 8 bytes of the base name of the process's executable file.
.RE

.sp
.ne 2
.na
\fB\fBctid\fR\fR
.ad
.RS 11n
The contract ID of the process contract the process is a member of as a decimal
integer.
.RE

.sp
.ne 2
.na
\fB\fBlgrp\fR\fR
.ad
.RS 11n
The home lgroup of the process.
.RE

.sp
.ne 2
.na
\fB\fBdmodel\fR\fR
.ad
.RS 11n
The data model of the process, printed in the same manner as via
\fBpflags\fR(1). The currently supported data models are _ILP32 and _LP64.
.RE

.sp
.LP
Only \fBcomm\fR, \fBlwpname\fR, and \fBargs\fR are allowed to contain blank
characters; all others, including the illumos implementation variables, are not.
.sp
.LP
The following table specifies the default header to be used in the POSIX locale
corresponding to each format specifier.
.sp

.sp
.TS
box;
c c c c
c c c c .
Format	Default	Format	Default
Specifier	Header	Specifier	Header
_
args	COMMAND	ppid	PPID
comm	COMMAND	rgroup	RGROUP
etime	ELAPSED	ruser	RUSER
group	GROUP	time	TIME
nice	NI	tty	TT
pcpu	%CPU	user	USER
pgid	PGID	vsz	VSZ
pid	PID
.TE

.sp
.LP
The following table lists the illumos implementation format specifiers and the
default header used with each.
.sp

.sp
.TS
box;
c c c c
c c c c .
Format	Default	Format	Default
Specifier	Header	Specifier	Header
_
addr	ADDR	projid	PROJID
c	C	project	PROJECT
class	CLS	psr	PSR
f	F	rgid	RGID
fname	COMMAND	rss	RSS
gid	GID	ruid	RUID
lgrp	LGRP	s	S
lwp	LWP	sid	SID
lwpname	LWPNAME	stime	STIME
nlwp	NLWP	taskid	TASKID
opri	PRI	uid	UID
osz	SZ	wchan	WCHAN
pmem	%MEM	zone	ZONE
pri	PRI	zoneid	ZONEID
ctid	CTID
.TE

.SH EXAMPLES
\fBExample 1 \fRUsing \fBps\fR Command
.sp
.LP
The command:

.sp
.in +2
.nf
example% \fBps -o user,pid,ppid=MOM -o args\fR
.fi
.in -2
.sp

.sp
.LP
writes the following in the POSIX locale:

.sp
.in +2
.nf
 USER  PID   MOM   COMMAND
helene  34    12   ps -o uid,pid,ppid=MOM -o args
.fi
.in -2
.sp

.sp
.LP
The contents of the \fBCOMMAND\fR field need not be the same due to possible
truncation.

.SH ENVIRONMENT VARIABLES
See \fBenviron\fR(5) for descriptions of the following environment variables
that affect the execution of \fBps\fR: \fBLANG\fR, \fBLC_ALL\fR,
\fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
.sp
.ne 2
.na
\fB\fBCOLUMNS\fR\fR
.ad
.RS 11n
Override the system-selected horizontal screen size, used to determine the
number of text columns to display.
.RE

.SH EXIT STATUS
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred.
.RE

.SH FILES
.ne 2
.na
\fB\fB/dev/pts/*\fR\fR
.ad
.RS 15n

.RE

.sp
.ne 2
.na
\fB\fB/dev/term/*\fR\fR
.ad
.RS 15n
terminal (``tty'') names searcher files
.RE

.sp
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 15n
\fBUID\fR information supplier
.RE

.sp
.ne 2
.na
\fB\fB/proc/*\fR\fR
.ad
.RS 15n
process control files
.RE

.SH ATTRIBUTES
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
CSI	Enabled (see USAGE)
_
Interface Stability	Committed
_
Standard	See \fBstandards\fR(5).
.TE

.SH SEE ALSO
\fBkill\fR(1), \fBlgrpinfo\fR(1), \fBnice\fR(1), \fBpagesize\fR(1),
\fBpmap\fR(1), \fBpriocntl\fR(1), \fBps\fR(1b), \fBwho\fR(1), \fBgetty\fR(1M),
\fBproc\fR(4),
\fBttysrch\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
\fBresource_controls\fR(5), \fBstandards\fR(5), \fBzones\fR(5)
.SH NOTES
Things can change while \fBps\fR is running. The snapshot it gives is true only
for a split-second, and it might not be accurate by the time you see it. Some
data printed for defunct processes is irrelevant.
.sp
.LP
If no options to select processes are specified, \fBps\fR reports all processes
associated with the controlling terminal. If there is no controlling terminal,
there is no report other than the header.
.sp
.LP
\fBps\fR \fB-ef\fR or \fBps\fR \fB-o\fR \fBstime\fR might not report the actual
start of a tty login session, but rather an earlier time, when a getty was last
respawned on the tty line.
.sp
.LP
\fBps\fR is \fBCSI\fR-enabled except for login names (usernames).