When the -o
option is not specified, the standard output format
is unspecified.
On XSI-conformant systems, the output format shall be as follows.
The column headings and descriptions of the columns in a ps
listing are given below. The precise meanings of these fields are
implementation-defined. The letters 'f'
and 'l'
(below) indicate
the option (full
or long
) that shall cause the corresponding
heading to appear; all
means that the heading always appears.
Note that these two options determine only what information is
provided for a process; they do not determine which processes are
listed.
F
(l) Flags (octal and additive) associated with
the process.
S
(l) The state of the process.
UID
(f,l) The user ID number of the process owner;
the login name is printed under the -f
option.
PID
(all) The process ID of the process; it is
possible to kill a process if this datum is
known.
PPID
(f,l) The process ID of the parent process.
C
(f,l) Processor utilization for scheduling.
PRI
(l) The priority of the process; higher numbers
mean lower priority.
NI
(l) Nice value; used in priority computation.
ADDR
(l) The address of the process.
SZ
(l) The size in blocks of the core image of the
process.
WCHAN
(l) The event for which the process is waiting
or sleeping; if blank, the process is
running.
STIME
(f) Starting time of the process.
TTY
(all) The controlling terminal for the process.
TIME
(all) The cumulative execution time for the
process.
CMD
(all) The command name; the full command name and
its arguments are written under the -f
option.
A process that has exited and has a parent, but has not yet been
waited for by the parent, shall be marked defunct
.
Under the option -f
, ps tries to determine the command name and
arguments given when the process was created by examining memory
or the swap area. Failing this, the command name, as it would
appear without the option -f
, is written in square brackets.
The -o
option allows the output format to be specified under user
control.
The application shall ensure that the format specification is 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 shall be used as the header text. The fields specified
shall be written in the order specified on the command line, and
should be arranged in columns in the output. The field widths
shall be 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 -o
user=, the field width shall be at least as wide
as the default header text. If all header text fields are null,
no header line shall be written.
The following names are recognized in the POSIX locale:
ruser
The real user ID of the process. This shall be the
textual user ID, if it can be obtained and the field
width permits, or a decimal representation otherwise.
user
The effective user ID of the process. This shall be the
textual user ID, if it can be obtained and the field
width permits, or a decimal representation otherwise.
rgroup
The real group ID of the process. This shall be the
textual group ID, if it can be obtained and the field
width permits, or a decimal representation otherwise.
group
The effective group ID of the process. This shall be the
textual group ID, if it can be obtained and the field
width permits, or a decimal representation otherwise.
pid
The decimal value of the process ID.
ppid
The decimal value of the parent process ID.
pgid
The decimal value of the process group ID.
pcpu
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.
vsz
The size of the process in (virtual) memory in 1024 byte
units as a decimal integer.
nice
The decimal value of the nice value of the process; see
nice.
etime
In the POSIX locale, the elapsed time since the process
was started, in the form:
[[
dd-]
hh:]
mm:ss
where dd shall represent the number of days, hh the
number of hours, mm the number of minutes, and ss the
number of seconds. The dd field shall be a decimal
integer. The hh, mm, and ss fields shall be two-digit
decimal integers padded on the left with zeros.
time
In the POSIX locale, the cumulative CPU time of the
process in the form:
[
dd-]
hh:mm:ss
The dd, hh, mm, and ss fields shall be as described in
the etime
specifier.
tty
The name of the controlling terminal of the process (if
any) in the same format used by the who utility.
comm
The name of the command being executed (argv[0] value) as
a string.
args
The command with all its arguments as a string. The
implementation may truncate this value to the field
width; it is implementation-defined 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 may 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 ps.
Any field need not be meaningful in all implementations. In such
a case a <hyphen-minus> ('-'
) should be output in place of the
field value.
Only comm
and args
shall be allowed to contain <blank>
characters; all others shall not. Any implementation-defined
variables shall be specified in the system documentation along
with the default header and indicating whether the field may
contain <blank> characters.
The following table specifies the default header to be used in
the POSIX locale corresponding to each format specifier.
Table: Variable Names and Default Headers in
ps
┌──────────────────────────────────┬───────────────────────────────────┐
│Format Specifier Default Header
│ Format Specifier Default 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
│ │
└──────────────────────────────────┴───────────────────────────────────┘