2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
4 .\" Copyright (c) 2012, Joyent, Inc. All Rights Reserved
5 .\" Copyright (c) 2013 Gary Mills
6 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
7 .\" 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/.
8 .\" 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
9 .\" are reprinted and reproduced in electronic form in the Sun OS 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
10 .\" 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.
11 .\" This notice shall appear on any product containing this material.
12 .\" 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.
13 .\" 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
14 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
15 .TH PS 1 "Apr 16, 2013"
17 ps \- report process status
21 \fBps\fR [\fB-aAcdefjHlLPWyZ\fR] [\fB-g\fR \fIgrplist\fR] [\fB-h\fR \fIlgrplist\fR]
22 [\fB-n\fR \fInamelist\fR] [\fB-o\fR \fIformat\fR]... [\fB-p\fR \fIproclist\fR]
23 [\fB-s\fR \fIsidlist\fR] [\fB-t\fR \fIterm\fR] [\fB-u\fR \fIuidlist\fR] [\fB-U\fR \fIuidlist\fR]
24 [\fB-G\fR \fIgidlist\fR] [\fB-z\fR \fIzonelist\fR]
30 The \fBps\fR command prints information about active processes. Without
31 options, \fBps\fR prints information about processes that have the same
32 effective user \fBID\fR and the same controlling terminal as the invoker. The
33 output contains only the process \fBID\fR, terminal identifier, cumulative
34 execution time, and the command name. Otherwise, the information that is
35 displayed is controlled by the options.
38 Some options accept lists as arguments. Items in a list can be either separated
39 by commas or else enclosed in quotes and separated by commas or spaces. Values
40 for \fIproclist\fR and \fIgrplist\fR must be numeric.
44 The following options are supported:
51 Lists information about \fBa\fRll processes most frequently requested: all
52 those except session leaders and processes not associated with a terminal.
61 Lists information for all processes. Identical to \fB-e\fR, below.
70 Prints information in a format that reflects scheduler properties as described
71 in \fBpriocntl\fR(1). The \fB-c\fR option affects the output of the \fB-f\fR
72 and \fB-l\fR options, as described below.
81 Lists information about all processes except session leaders.
90 Lists information about \fBe\fRvery process now running.
92 When the \fB-e\fRoption is specified, options \fB-z\fR, \fB-t\fR, \fB-u\fR,
93 \fB-U\fR, \fB-g\fR, \fB-G\fR, \fB-p\fR, \fB-g\fR, \fB-s\fR and \fB-a\fR options
103 Generates a \fBf\fRull listing. (See below for significance of columns in a
110 \fB\fB-g\fR \fIgrplist\fR\fR
113 Lists only process data whose group leader's \fBID\fR number(s) appears in
114 \fIgrplist\fR. (A group leader is a process whose process \fBID\fR number is
115 identical to its process group \fBID\fR number.)
121 \fB\fB-G\fR \fIgidlist\fR\fR
124 Lists information for processes whose real group ID numbers are given in
125 \fIgidlist\fR. The \fIgidlist\fR must be a single argument in the form of a
126 blank- or comma-separated list.
132 \fB\fB-h\fR \fIlgrplist\fR\fR
135 Lists only the processes homed to the specified \fIlgrplist\fR. Nothing is
136 listed for any invalid group specified in \fIlgrplist\fR.
145 Prints the home lgroup of the process under an additional column header, LGRP.
154 Prints session \fBID\fR and process group \fBID\fR.
163 Generates a \fBl\fRong listing. (See below.)
172 Prints information about each light weight process (\fIlwp\fR) in each selected
173 process. (See below.)
179 \fB\fB-n\fR \fInamelist\fR\fR
182 Specifies the name of an alternative system \fInamelist\fR file in place of the
183 default. This option is accepted for compatibility, but is ignored.
189 \fB\fB-o\fR \fIformat\fR\fR
192 Prints information according to the format specification given in \fIformat\fR.
193 This is fully described in \fBDISPLAY FORMATS\fR. Multiple \fB-o\fR options can
194 be specified; the format specification is interpreted as the
195 space-character-separated concatenation of all the \fIformat\fR
202 \fB\fB-p\fR \fIproclist\fR\fR
205 Lists only process data whose process \fBID\fR numbers are given in
215 Prints the number of the processor to which the process or lwp is bound, if
216 any, under an additional column header, \fBPSR\fR.
222 \fB\fB-s\fR \fIsidlist\fR\fR
225 Lists information on all session leaders whose \fBID\fRs appear in
232 \fB\fB-t\fR \fIterm\fR\fR
235 Lists only process data associated with \fIterm\fR. Terminal identifiers are
236 specified as a device file name, and an identifier. For example, \fBterm/a\fR,
243 \fB\fB-u\fR \fIuidlist\fR\fR
246 Lists only process data whose effective user \fBID\fR number or login name is
247 given in \fIuidlist\fR. In the listing, the numerical user \fBID\fR is printed
248 unless you give the \fB-f\fR option, which prints the login name.
254 \fB\fB-U\fR \fIuidlist\fR\fR
257 Lists information for processes whose real user \fBID\fR numbers or login names
258 are given in \fIuidlist\fR. The \fIuidlist\fR must be a single argument in the
259 form of a blank- or comma-separated list.
268 Truncate long names even when \fBps\fR would normally print them
270 A trailing asterisk marks a long name that has been truncated
280 Under a long listing (\fB-l\fR), omits the obsolete \fBF\fR and \fBADDR\fR
281 columns and includes an \fBRSS\fR column to report the resident set size of the
282 process. Under the \fB-y\fR option, both \fBRSS\fR and \fBSZ\fR (see below) is
283 reported in units of kilobytes instead of pages.
289 \fB\fB-z\fR \fIzonelist\fR\fR
292 Lists only processes in the specified zones. Zones can be specified either by
293 name or ID. This option is only useful when executed in the global zone.
302 Prints the name of the zone with which the process is associated under an
303 additional column header, \fBZONE\fR. The \fBZONE\fR column width is limited to
304 8 characters. Use \fBps\fR \fB-eZ\fR for a quick way to see information about
305 every process now running along with the associated zone name. Use
309 ps -eo zone,uid,pid,ppid,time,comm,...
314 to see zone names wider than 8 characters.
319 Many of the options shown are used to select processes to list. If any are
320 specified, the default list is ignored and \fBps\fR selects the processes
321 represented by the inclusive OR of all the selection-criteria options.
325 Under the \fB-f\fR option, \fBps\fR tries to determine the command name and
326 arguments given when the process was created by examining the user block.
327 Failing this, the command name is printed, as it would have appeared without
328 the \fB-f\fR option, in square brackets.
331 The column headings and the meaning of the columns in a \fBps\fR listing are
332 given below; the letters \fBf\fR and \fBl\fR indicate the option (f\fBull\fR or
333 \fBl\fRong, respectively) that causes the corresponding heading to appear;
334 \fBall\fR means that the heading always appears. \fBNote:\fR These two options
335 determine only what information is provided for a process; they do not
336 determine which processes are listed.
343 Flags (hexadecimal and additive) associated with the process. These flags are
344 available for historical purposes; no meaning should be currently ascribed to
354 The state of the process:
361 Process is running on a processor.
370 Sleeping: process is waiting for an event to complete.
379 Runnable: process is on run queue.
388 Process is stopped, either by a job control signal or because it is being
398 Waiting: process is waiting for CPU usage to drop to the CPU-caps enforced
408 Zombie state: process terminated and parent not waiting.
416 \fB\fBUID\fR (f,l)\fR
419 The effective user \fBID\fR number of the process (the login name is printed
420 under the \fB-f\fR option).
421 A trailing asterisk marks a long name that has been truncated
431 The process \fBID\fR of the process (this datum is necessary in order to kill a
438 \fB\fBPPID\fR(f,l)\fR
441 The process \fBID\fR of the parent process.
450 Processor utilization for scheduling (obsolete). Not printed when the \fB-c\fR
460 Scheduling class. Printed only when the \fB-c\fR option is used.
469 The priority of the process. Without the \fB-c\fR option, higher numbers mean
470 lower priority. With the \fB-c\fR option, higher numbers mean higher priority.
479 Nice value, used in priority computation. Not printed when the \fB-c\fR option
480 is used. Only processes in the certain scheduling classes have a nice value.
489 The memory address of the process.
498 The total size of the process in virtual memory, including all mapped files and
499 devices, in pages. See \fBpagesize\fR(1).
508 The address of an event for which the process is sleeping (if blank, the
518 The starting time of the process, given in hours, minutes, and seconds. (A
519 process begun more than twenty-four hours before the \fBps\fR inquiry is
520 executed is given in months and days.)
529 The controlling terminal for the process (the message, \fB?\fR, is printed when
530 there is no controlling terminal).
536 \fB\fBTIME\fR(all)\fR
539 The cumulative execution time for the process.
545 \fB\fBLTIME\fR(all)\fR
548 The execution time for the lwp being reported.
557 The command name (the full command name and its arguments, up to a limit of 80
558 characters, are printed under the \fB-f\fR option).
563 The following two additional columns are printed when the \fB-j\fR option is
571 The process ID of the process group leader.
580 The process ID of the session leader.
585 The following two additional columns are printed when the \fB-L\fR option is
593 The lwp ID of the lwp being reported.
602 The number of lwps in the process (if \fB-f\fR is also specified).
607 Under the \fB-L\fR option, one line is printed for each lwp in the process and
608 the time-reporting fields \fBSTIME\fR and \fBLTIME\fR show the values for the
609 lwp, not the process. A traditional single-threaded process contains only one
613 A process that has exited and has a parent, but has not yet been waited for by
614 the parent, is marked \fB<defunct>\fR\&.
615 .SS "\fB-o\fR format"
618 The \fB-o\fR option allows the output format to be specified under user
622 The format specification must be a list of names presented as a single
623 argument, blank- or comma-separated. Each variable has a default header. The
624 default header can be overridden by appending an equals sign and the new text
625 of the header. The rest of the characters in the argument is used as the header
626 text. The fields specified are written in the order specified on the command
627 line, and should be arranged in columns in the output. The field widths are
628 selected by the system to be at least as wide as the header text (default or
629 overridden value). If the header text is null, such as \fB-o\fR \fIuser=,\fR
630 the field width is at least as wide as the default header text.
631 Long names are not truncated in this mode.
632 If all header text fields are null, no header line is written.
635 The following names are recognized in the POSIX locale:
642 The effective user \fBID\fR of the process. This is the textual user \fBID\fR,
643 if it can be obtained and the field width permits, or a decimal representation
653 The real user \fBID\fR of the process. This is the textual user \fBID\fR, if it
654 can be obtained and the field width permits, or a decimal representation
664 The effective group \fBID\fR of the process. This is the textual group
665 \fBID,\fR if it can be obtained and the field width permits, or a decimal
666 representation otherwise.
675 The real group \fBID\fR of the process. This is the textual group \fBID,\fR if
676 it can be obtained and the field width permits, or a decimal representation
686 The decimal value of the process \fBID\fR.
695 The decimal value of the parent process \fBID\fR.
704 The decimal value of the process group \fBID.\fR
713 The ratio of CPU time used recently to CPU time available in the same period,
714 expressed as a percentage. The meaning of ``recently'' in this context is
715 unspecified. The CPU time available is determined in an unspecified manner.
724 The total size of the process in virtual memory, in kilobytes.
733 The decimal value of the system scheduling priority of the process. See
743 In the POSIX locale, the elapsed time since the process was started, in the
746 \fB[[\fR\fIdd\fR-\fB]\fR\fIhh\fR:\fB]\fR\fImm\fR:\fIss\fR
755 is the number of days
764 is the number of hours
773 is the number of minutes
782 is the number of seconds
785 The \fIdd\fR field is a decimal integer. The \fIhh\fR, \fImm\fR and \fIss\fR
786 fields is two-digit decimal integers padded on the left with zeros.
795 In the POSIX locale, the cumulative CPU time of the process in the form:
797 \fB[\fR\fIdd\fR-\fB]\fR\fIhh\fR:\fImm\fR:\fIss\fR
799 The \fIdd\fR, \fIhh\fR, \fImm\fR, and \fIss\fR fields is as described in the
800 \fBetime\fR specifier.
809 The name of the controlling terminal of the process (if any) in the same format
810 used by the \fBwho\fR(1) command.
819 The name of the command being executed (\fBargv[0]\fR value) as a string.
828 The command with all its arguments as a string. The implementation might
829 truncate this value to the field width; it is implementation-dependent whether
830 any further truncation occurs. It is unspecified whether the string represented
831 is a version of the argument list as it was passed to the command when it
832 started, or is a version of the arguments as they might have been modified by
833 the application. Applications cannot depend on being able to modify their
834 argument list and having that modification be reflected in the output of
835 \fBps\fR. The Solaris implementation limits the string to 80 bytes; the string
836 is the version of the argument list as it was passed to the command when it
842 The following names are recognized in the Solaris implementation:
849 Flags (hexadecimal and additive) associated with the process.
858 The state of the process.
867 Processor utilization for scheduling (obsolete).
876 The effective user \fBID\fR number of the process as a decimal integer.
885 The real user \fBID\fR number of the process as a decimal integer.
894 The effective group \fBID\fR number of the process as a decimal integer.
903 The real group \fBID\fR number of the process as a decimal integer.
912 The project \fBID\fR number of the process as a decimal integer.
921 The project \fBID\fR of the process as a textual value if that value can be
922 obtained; otherwise, as a decimal integer.
931 The zone \fBID\fR number of the process as a decimal integer.
940 The zone \fBID\fR of the process as a textual value if that value can be
941 obtained; otherwise, as a decimal integer.
950 The process ID of the session leader.
959 The task \fBID\fR of the process.
968 The scheduling class of the process.
977 The priority of the process. Higher numbers mean higher priority.
986 The obsolete priority of the process. Lower numbers mean higher priority.
995 The decimal value of the lwp \fBID\fR. Requesting this formatting option causes
996 one line to be printed for each lwp in the process.
1005 The number of lwps in the process.
1014 The number of the processor to which the process or lwp is bound.
1023 The \fBID\fR of the processor set to which the process or lwp is bound.
1032 The memory address of the process.
1041 The total size of the process in virtual memory, in pages.
1050 The address of an event for which the process is sleeping (if \(mi, the process
1060 The starting time or date of the process, printed with no blanks.
1069 The resident set size of the process, in kilobytes. The \fBrss\fR value
1070 reported by \fBps\fR is an estimate provided by \fBproc\fR(4) that might
1071 underestimate the actual resident set size. Users who wish to get more accurate
1072 usage information for capacity planning should use \fBpmap\fR(1) \fB-x\fR
1082 The ratio of the process's resident set size to the physical memory on the
1083 machine, expressed as a percentage.
1092 The first 8 bytes of the base name of the process's executable file.
1101 The contract ID of the process contract the process is a member of as a decimal
1111 The home lgroup of the process.
1120 The data model of the process, printed in the same manner as via
1121 \fBpflags\fR(1). The currently supported data models are _ILP32 and _LP64.
1126 Only \fBcomm\fR and \fBargs\fR are allowed to contain blank characters; all
1127 others, including the Solaris implementation variables, are not.
1130 The following table specifies the default header to be used in the POSIX locale
1131 corresponding to each format specifier.
1139 Format Default Format Default
1140 Specifier Header Specifier Header
1142 args COMMAND ppid PPID
1143 comm COMMAND rgroup RGROUP
1144 etime ELAPSED ruser RUSER
1145 group GROUP time TIME
1154 The following table lists the Solaris implementation format specifiers and the
1155 default header used with each.
1163 Format Default Format Default
1164 Specifier Header Specifier Header
1166 addr ADDR projid PROJID
1170 fname COMMAND rss RSS
1174 nlwp NLWP stime STIME
1175 opri PRI taskid TASKID
1177 pmem %MEM wchan WCHAN
1179 ctid CTID zoneid ZONEID
1184 \fBExample 1 \fRUsing \fBps\fR Command
1192 example% \fBps -o user,pid,ppid=MOM -o args\fR
1199 writes the following in the POSIX locale:
1204 USER PID MOM COMMAND
1205 helene 34 12 ps -o uid,pid,ppid=MOM -o args
1212 The contents of the \fBCOMMAND\fR field need not be the same due to possible
1215 .SH ENVIRONMENT VARIABLES
1218 See \fBenviron\fR(5) for descriptions of the following environment variables
1219 that affect the execution of \fBps\fR: \fBLANG\fR, \fBLC_ALL\fR,
1220 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
1227 Override the system-selected horizontal screen size, used to determine the
1228 number of text columns to display.
1234 The following exit values are returned:
1241 Successful completion.
1257 \fB\fB/dev/pts/*\fR\fR
1266 \fB\fB/dev/term/*\fR\fR
1269 terminal (``tty'') names searcher files
1275 \fB\fB/etc/passwd\fR\fR
1278 \fBUID\fR information supplier
1287 process control files
1293 See \fBattributes\fR(5) for descriptions of the following attributes:
1301 ATTRIBUTE TYPE ATTRIBUTE VALUE
1303 CSI Enabled (see USAGE)
1305 Interface Stability Committed
1307 Standard See \fBstandards\fR(5).
1313 \fBkill\fR(1), \fBlgrpinfo\fR(1), \fBnice\fR(1), \fBpagesize\fR(1),
1314 \fBpmap\fR(1), \fBpriocntl\fR(1), \fBwho\fR(1), \fBgetty\fR(1M), \fBproc\fR(4),
1315 \fBttysrch\fR(4), \fBattributes\fR(5), \fBenviron\fR(5),
1316 \fBresource_controls\fR(5), \fBstandards\fR(5), \fBzones\fR(5)
1320 Things can change while \fBps\fR is running. The snapshot it gives is true only
1321 for a split-second, and it might not be accurate by the time you see it. Some
1322 data printed for defunct processes is irrelevant.
1325 If no options to select processes are specified, \fBps\fR reports all processes
1326 associated with the controlling terminal. If there is no controlling terminal,
1327 there is no report other than the header.
1330 \fBps\fR \fB-ef\fR or \fBps\fR \fB-o\fR \fBstime\fR might not report the actual
1331 start of a tty login session, but rather an earlier time, when a getty was last
1332 respawned on the tty line.
1335 \fBps\fR is \fBCSI\fR-enabled except for login names (usernames).