2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
45 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
46 .\" Copyright (c) 2013 Gary Mills
47 .\" Copyright (c) 2018, Joyent, Inc.
49 .TH PS 1 "August 22, 2018"
51 ps \- report process status
55 \fBps\fR [\fB-aAcdefjHlLPWyZ\fR] [\fB-g\fR \fIgrplist\fR] [\fB-h\fR \fIlgrplist\fR]
56 [\fB-n\fR \fInamelist\fR] [\fB-o\fR \fIformat\fR]... [\fB-p\fR \fIproclist\fR]
57 [\fB-s\fR \fIsidlist\fR] [\fB-t\fR \fIterm\fR] [\fB-u\fR \fIuidlist\fR] [\fB-U\fR \fIuidlist\fR]
58 [\fB-G\fR \fIgidlist\fR] [\fB-z\fR \fIzonelist\fR]
63 The \fBps\fR command prints information about active processes. Without
64 options, \fBps\fR prints information about processes that have the same
65 effective user \fBID\fR and the same controlling terminal as the invoker. The
66 output contains only the process \fBID\fR, terminal identifier, cumulative
67 execution time, and the command name. Otherwise, the information that is
68 displayed is controlled by the options.
71 Some options accept lists as arguments. Items in a list can be either separated
72 by commas or else enclosed in quotes and separated by commas or spaces. Values
73 for \fIproclist\fR and \fIgrplist\fR must be numeric.
76 The following options are supported:
83 Lists information about \fBa\fRll processes most frequently requested: all
84 those except session leaders and processes not associated with a terminal.
86 This option is ignored when the \fB-e\fR option is also specified.
95 Lists information for all processes. Identical to \fB-e\fR, below.
104 Prints information in a format that reflects scheduler properties as described
105 in \fBpriocntl\fR(1). The \fB-c\fR option affects the output of the \fB-f\fR
106 and \fB-l\fR options, as described below.
115 Lists information about all processes except session leaders.
124 Lists information about \fBe\fRvery process now running.
126 When the \fB-e\fR option is specified, options \fB-z\fR, \fB-t\fR, \fB-u\fR,
127 \fB-U\fR, \fB-g\fR, \fB-G\fR, \fB-p\fR, \fB-h\fR, \fB-s\fR and \fB-a\fR
137 Generates a \fBf\fRull listing. (See below for significance of columns in a
144 \fB\fB-g\fR \fIgrplist\fR\fR
147 Lists only process data whose group leader's \fBID\fR number(s) appears in
148 \fIgrplist\fR. (A group leader is a process whose process \fBID\fR number is
149 identical to its process group \fBID\fR number.)
151 This option is ignored when the \fB-e\fR option is also specified.
157 \fB\fB-G\fR \fIgidlist\fR\fR
160 Lists information for processes whose real group ID numbers are given in
161 \fIgidlist\fR. The \fIgidlist\fR must be a single argument in the form of a
162 blank- or comma-separated list.
164 This option is ignored when the \fB-e\fR option is also specified.
170 \fB\fB-h\fR \fIlgrplist\fR\fR
173 Lists only the processes homed to the specified \fIlgrplist\fR. Nothing is
174 listed for any invalid group specified in \fIlgrplist\fR.
176 This option is ignored when the \fB-e\fR option is also specified.
185 Prints the home lgroup of the process under an additional column header, LGRP.
194 Prints session \fBID\fR and process group \fBID\fR.
203 Generates a \fBl\fRong listing. (See below.)
212 Prints information about each light weight process (\fIlwp\fR) in each selected
213 process. (See below.)
219 \fB\fB-n\fR \fInamelist\fR\fR
222 Specifies the name of an alternative system \fInamelist\fR file in place of the
223 default. This option is accepted for compatibility, but is ignored.
229 \fB\fB-o\fR \fIformat\fR\fR
232 Prints information according to the format specification given in \fIformat\fR.
233 This is fully described in \fBDISPLAY FORMATS\fR. Multiple \fB-o\fR options can
234 be specified; the format specification is interpreted as the
235 space-character-separated concatenation of all the \fIformat\fR
242 \fB\fB-p\fR \fIproclist\fR\fR
245 Lists only process data whose process \fBID\fR numbers are given in
248 This option is ignored when the \fB-e\fR option is also specified.
257 Prints the number of the processor to which the process or lwp is bound, if
258 any, under an additional column header, \fBPSR\fR.
264 \fB\fB-s\fR \fIsidlist\fR\fR
267 Lists information on all session leaders whose \fBID\fRs appear in
270 This option is ignored when the \fB-e\fR option is also specified.
276 \fB\fB-t\fR \fIterm\fR\fR
279 Lists only process data associated with \fIterm\fR. Terminal identifiers are
280 specified as a device file name, and an identifier. For example, \fBterm/a\fR,
283 This option is ignored when the \fB-e\fR option is also specified.
289 \fB\fB-u\fR \fIuidlist\fR\fR
292 Lists only process data whose effective user \fBID\fR number or login name is
293 given in \fIuidlist\fR. In the listing, the numerical user \fBID\fR is printed
294 unless you give the \fB-f\fR option, which prints the login name.
296 This option is ignored when the \fB-e\fR option is also specified.
302 \fB\fB-U\fR \fIuidlist\fR\fR
305 Lists information for processes whose real user \fBID\fR numbers or login names
306 are given in \fIuidlist\fR. The \fIuidlist\fR must be a single argument in the
307 form of a blank- or comma-separated list.
309 This option is ignored when the \fB-e\fR option is also specified.
318 Truncate long names even when \fBps\fR would normally print them
320 A trailing asterisk marks a long name that has been truncated
330 Under a long listing (\fB-l\fR), omits the obsolete \fBF\fR and \fBADDR\fR
331 columns and includes an \fBRSS\fR column to report the resident set size of the
332 process. Under the \fB-y\fR option, both \fBRSS\fR and \fBSZ\fR (see below) is
333 reported in units of kilobytes instead of pages.
339 \fB\fB-z\fR \fIzonelist\fR\fR
342 Lists only processes in the specified zones. Zones can be specified either by
343 name or ID. This option is only useful when executed in the global zone.
345 This option is ignored when the \fB-e\fR option is also specified.
354 Prints the name of the zone with which the process is associated under an
355 additional column header, \fBZONE\fR. The \fBZONE\fR column width is limited to
356 8 characters. Use \fBps\fR \fB-eZ\fR for a quick way to see information about
357 every process now running along with the associated zone name. Use
361 ps -eo zone,uid,pid,ppid,time,comm,...
366 to see zone names wider than 8 characters.
371 Many of the options shown are used to select processes to list. If any are
372 specified, the default list is ignored and \fBps\fR selects the processes
373 represented by the inclusive OR of all the selection-criteria options.
376 Under the \fB-f\fR option, \fBps\fR tries to determine the command name and
377 arguments given when the process was created by examining the user block.
378 Failing this, the command name is printed, as it would have appeared without
379 the \fB-f\fR option, in square brackets.
382 The column headings and the meaning of the columns in a \fBps\fR listing are
383 given below; the letters \fBf\fR and \fBl\fR indicate the option (f\fBull\fR or
384 \fBl\fRong, respectively) that causes the corresponding heading to appear;
385 \fBall\fR means that the heading always appears. \fBNote:\fR These two options
386 determine only what information is provided for a process; they do not
387 determine which processes are listed.
394 Flags (hexadecimal and additive) associated with the process. These flags are
395 available for historical purposes; no meaning should be currently ascribed to
405 The state of the process:
412 Process is running on a processor.
421 Sleeping: process is waiting for an event to complete.
430 Runnable: process is on run queue.
439 Process is stopped, either by a job control signal or because it is being
449 Waiting: process is waiting for CPU usage to drop to the CPU-caps enforced
459 Zombie state: process terminated and parent not waiting.
467 \fB\fBUID\fR (f,l)\fR
470 The effective user \fBID\fR number of the process (the login name is printed
471 under the \fB-f\fR option).
472 A trailing asterisk marks a long name that has been truncated
482 The process \fBID\fR of the process (this datum is necessary in order to kill a
489 \fB\fBPPID\fR(f,l)\fR
492 The process \fBID\fR of the parent process.
501 Processor utilization for scheduling (obsolete). Not printed when the \fB-c\fR
511 Scheduling class. Printed only when the \fB-c\fR option is used.
520 The priority of the process. Without the \fB-c\fR option, higher numbers mean
521 lower priority. With the \fB-c\fR option, higher numbers mean higher priority.
530 Nice value, used in priority computation. Not printed when the \fB-c\fR option
531 is used. Only processes in the certain scheduling classes have a nice value.
540 The memory address of the process.
549 The total size of the process in virtual memory, including all mapped files and
550 devices, in pages. See \fBpagesize\fR(1).
559 The address of an event for which the process is sleeping (if blank, the
569 The starting time of the process, given in hours, minutes, and seconds. (A
570 process begun more than twenty-four hours before the \fBps\fR inquiry is
571 executed is given in months and days.)
580 The controlling terminal for the process (the message, \fB?\fR, is printed when
581 there is no controlling terminal).
587 \fB\fBTIME\fR(all)\fR
590 The cumulative execution time for the process.
596 \fB\fBLTIME\fR(all)\fR
599 The execution time for the lwp being reported.
608 The command name (the full command name and its arguments, up to a limit of 80
609 characters, are printed under the \fB-f\fR option).
614 The following two additional columns are printed when the \fB-j\fR option is
622 The process ID of the process group leader.
631 The process ID of the session leader.
636 The following two additional columns are printed when the \fB-L\fR option is
644 The lwp ID of the lwp being reported.
653 The number of lwps in the process (if \fB-f\fR is also specified).
658 Under the \fB-L\fR option, one line is printed for each lwp in the process and
659 the time-reporting fields \fBSTIME\fR and \fBLTIME\fR show the values for the
660 lwp, not the process. A traditional single-threaded process contains only one
664 A process that has exited and has a parent, but has not yet been waited for by
665 the parent, is marked \fB<defunct>\fR\&.
666 .SS "\fB-o\fR format"
668 The \fB-o\fR option allows the output format to be specified under user
672 The format specification must be a list of names presented as a single
673 argument, blank- or comma-separated. Each variable has a default header. The
674 default header can be overridden by appending an equals sign and the new text
675 of the header. The rest of the characters in the argument is used as the header
676 text. The fields specified are written in the order specified on the command
677 line, and should be arranged in columns in the output. The field widths are
678 selected by the system to be at least as wide as the header text (default or
679 overridden value). If the header text is null, such as \fB-o\fR \fIuser=,\fR
680 the field width is at least as wide as the default header text.
681 Long names are not truncated in this mode.
682 If all header text fields are null, no header line is written.
685 The following names are recognized in the POSIX locale:
692 The effective user \fBID\fR of the process. This is the textual user \fBID\fR,
693 if it can be obtained and the field width permits, or a decimal representation
703 The real user \fBID\fR of the process. This is the textual user \fBID\fR, if it
704 can be obtained and the field width permits, or a decimal representation
714 The effective group \fBID\fR of the process. This is the textual group
715 \fBID,\fR if it can be obtained and the field width permits, or a decimal
716 representation otherwise.
725 The real group \fBID\fR of the process. This is the textual group \fBID,\fR if
726 it can be obtained and the field width permits, or a decimal representation
736 The decimal value of the process \fBID\fR.
745 The decimal value of the parent process \fBID\fR.
754 The decimal value of the process group \fBID.\fR
763 The ratio of CPU time used recently to CPU time available in the same period,
764 expressed as a percentage. The meaning of ``recently'' in this context is
765 unspecified. The CPU time available is determined in an unspecified manner.
774 The total size of the process in virtual memory, in kilobytes.
783 The decimal value of the system scheduling priority of the process. See
793 In the POSIX locale, the elapsed time since the process was started, in the
796 \fB[[\fR\fIdd\fR-\fB]\fR\fIhh\fR:\fB]\fR\fImm\fR:\fIss\fR
805 is the number of days
814 is the number of hours
823 is the number of minutes
832 is the number of seconds
835 The \fIdd\fR field is a decimal integer. The \fIhh\fR, \fImm\fR and \fIss\fR
836 fields is two-digit decimal integers padded on the left with zeros.
845 In the POSIX locale, the cumulative CPU time of the process in the form:
847 \fB[\fR\fIdd\fR-\fB]\fR\fIhh\fR:\fImm\fR:\fIss\fR
849 The \fIdd\fR, \fIhh\fR, \fImm\fR, and \fIss\fR fields is as described in the
850 \fBetime\fR specifier.
859 The name of the controlling terminal of the process (if any) in the same format
860 used by the \fBwho\fR(1) command.
869 The name of the command being executed (\fBargv[0]\fR value) as a string.
878 The command with all its arguments as a string. The implementation might
879 truncate this value to the field width; it is implementation-dependent whether
880 any further truncation occurs. It is unspecified whether the string represented
881 is a version of the argument list as it was passed to the command when it
882 started, or is a version of the arguments as they might have been modified by
883 the application. Applications cannot depend on being able to modify their
884 argument list and having that modification be reflected in the output of
885 \fBps\fR. The illumos implementation limits the string to 80 bytes; the string
886 is the version of the argument list as it was passed to the command when it
892 The following names are recognized in the illumos implementation:
899 Flags (hexadecimal and additive) associated with the process.
908 The state of the process.
917 Processor utilization for scheduling (obsolete).
926 The effective user \fBID\fR number of the process as a decimal integer.
935 The real user \fBID\fR number of the process as a decimal integer.
944 The effective group \fBID\fR number of the process as a decimal integer.
953 The real group \fBID\fR number of the process as a decimal integer.
962 The project \fBID\fR number of the process as a decimal integer.
971 The project \fBID\fR of the process as a textual value if that value can be
972 obtained; otherwise, as a decimal integer.
981 The zone \fBID\fR number of the process as a decimal integer.
990 The zone \fBID\fR of the process as a textual value if that value can be
991 obtained; otherwise, as a decimal integer.
1000 The process ID of the session leader.
1009 The task \fBID\fR of the process.
1018 The scheduling class of the process.
1027 The priority of the process. Higher numbers mean higher priority.
1036 The obsolete priority of the process. Lower numbers mean higher priority.
1045 The decimal value of the lwp \fBID\fR. Requesting this formatting option causes
1046 one line to be printed for each lwp in the process.
1055 The name of the lwp, if set. Requesting this formatting option causes
1056 one line to be printed for each lwp in the process.
1065 The number of lwps in the process.
1074 The number of the processor to which the process or lwp is bound.
1083 The \fBID\fR of the processor set to which the process or lwp is bound.
1092 The memory address of the process.
1101 The total size of the process in virtual memory, in pages.
1110 The address of an event for which the process is sleeping (if \(mi, the process
1120 The starting time or date of the process, printed with no blanks.
1129 The resident set size of the process, in kilobytes. The \fBrss\fR value
1130 reported by \fBps\fR is an estimate provided by \fBproc\fR(4) that might
1131 underestimate the actual resident set size. Users who wish to get more accurate
1132 usage information for capacity planning should use \fBpmap\fR(1) \fB-x\fR
1142 The ratio of the process's resident set size to the physical memory on the
1143 machine, expressed as a percentage.
1152 The first 8 bytes of the base name of the process's executable file.
1161 The contract ID of the process contract the process is a member of as a decimal
1171 The home lgroup of the process.
1180 The data model of the process, printed in the same manner as via
1181 \fBpflags\fR(1). The currently supported data models are _ILP32 and _LP64.
1186 Only \fBcomm\fR, \fBlwpname\fR, and \fBargs\fR are allowed to contain blank
1187 characters; all others, including the illumos implementation variables, are not.
1190 The following table specifies the default header to be used in the POSIX locale
1191 corresponding to each format specifier.
1199 Format Default Format Default
1200 Specifier Header Specifier Header
1202 args COMMAND ppid PPID
1203 comm COMMAND rgroup RGROUP
1204 etime ELAPSED ruser RUSER
1205 group GROUP time TIME
1214 The following table lists the illumos implementation format specifiers and the
1215 default header used with each.
1223 Format Default Format Default
1224 Specifier Header Specifier Header
1226 addr ADDR projid PROJID
1230 fname COMMAND rss RSS
1234 lwpname LWPNAME stime STIME
1235 nlwp NLWP taskid TASKID
1239 pri PRI zoneid ZONEID
1245 \fBExample 1 \fRUsing \fBps\fR Command
1253 example% \fBps -o user,pid,ppid=MOM -o args\fR
1260 writes the following in the POSIX locale:
1265 USER PID MOM COMMAND
1266 helene 34 12 ps -o uid,pid,ppid=MOM -o args
1273 The contents of the \fBCOMMAND\fR field need not be the same due to possible
1276 .SH ENVIRONMENT VARIABLES
1278 See \fBenviron\fR(5) for descriptions of the following environment variables
1279 that affect the execution of \fBps\fR: \fBLANG\fR, \fBLC_ALL\fR,
1280 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
1287 Override the system-selected horizontal screen size, used to determine the
1288 number of text columns to display.
1293 The following exit values are returned:
1300 Successful completion.
1315 \fB\fB/dev/pts/*\fR\fR
1324 \fB\fB/dev/term/*\fR\fR
1327 terminal (``tty'') names searcher files
1333 \fB\fB/etc/passwd\fR\fR
1336 \fBUID\fR information supplier
1345 process control files
1350 See \fBattributes\fR(5) for descriptions of the following attributes:
1358 ATTRIBUTE TYPE ATTRIBUTE VALUE
1360 CSI Enabled (see USAGE)
1362 Interface Stability Committed
1364 Standard See \fBstandards\fR(5).
1369 \fBkill\fR(1), \fBlgrpinfo\fR(1), \fBnice\fR(1), \fBpagesize\fR(1),
1370 \fBpmap\fR(1), \fBpriocntl\fR(1), \fBwho\fR(1), \fBgetty\fR(1M), \fBproc\fR(4),
1371 \fBttysrch\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
1372 \fBresource_controls\fR(5), \fBstandards\fR(5), \fBzones\fR(5)
1375 Things can change while \fBps\fR is running. The snapshot it gives is true only
1376 for a split-second, and it might not be accurate by the time you see it. Some
1377 data printed for defunct processes is irrelevant.
1380 If no options to select processes are specified, \fBps\fR reports all processes
1381 associated with the controlling terminal. If there is no controlling terminal,
1382 there is no report other than the header.
1385 \fBps\fR \fB-ef\fR or \fBps\fR \fB-o\fR \fBstime\fR might not report the actual
1386 start of a tty login session, but rather an earlier time, when a getty was last
1387 respawned on the tty line.
1390 \fBps\fR is \fBCSI\fR-enabled except for login names (usernames).