psdisplay process status on Windows NT/2000 and POSIX compliant systems |
Command |
ps
[-Aacdefjl
]
[-G
idlist]
[-g
grouplist]
[-n
name]
[-o
format] ...
[-p
proclist]
[-s
idlist]
[-t
termlist]
[-U
|u
userlist]
ps
displays information about processes, provided that you
have appropriate privileges to obtain information about the requested processes.
ps
accepts several options. When a description says that
ps
lists all processes, it means all the processes
on the system, provided that you have appropriate privileges.
-A
displays information on all accessible processes. You can specify
-A
, -a
, and -e
in any combination, however, -a
overrides both
-A
and -e
.
-a
displays information on all processes associated with terminals. You
can specify -A
, -a
, and
-e
in any combination, however, -a
overrides both -A
and -e
.
-c
displays more detailed information about processes for the
-f
and -l
options. Accepted but
not currently implemented.
-d
displays information for all processes except group leaders.
-e
displays information on all accessible processes. You can specify
-A
, -a
, and -e
in any combination, however, -a
overrides both
-A
and -e
.
-f
displays information as if the user specified
-o ruser=UID -o pid,ppid,pcpu=C -o stime,tty=TTY -o atime,args
-G
idlistdisplays information on processes with process group numbers in idlist. Separate numbers in idlist with either blanks or commas.
-g
grouplistdisplays information on processes with real group ID numbers in grouplist. Separate numbers in grouplist with either blanks or commas.
-j
displays information as if the user specified
-o_pid,sid,pgid=PGRP_-o_tty=TTY_-o_atime,comm
-l
displays information as if the user specified
-o_flags,state,ruid=UID_-o_pid,ppid,pcpu=C -o pri,nice,addr,vsz=SZ -o wchan,tty=TTY -o atime,comm=CMD
-n
namespecifies the name of the executable containing the kernel symbol table.
-o
formatdisplays information according to the given format specifications. For further information, see Format Specifications.
-p
proclistdisplays information for processes with process ID numbers in proclist. Separate numbers in proclist with either blanks or commas.
-s
idlistdisplays information for processes with session ID numbers in idlist. Separate numbers in idlist with either blanks or commas.
-t
termlistdisplays information for processes with terminals in termlist.
You denote terminals in termlist with either the file name of the
device (for example, tty04
), or if the file name begins with
tty
, you can simply specify the characters following
tty
. For example, tty04
and 04
both
denote the same terminal. Terminals in termlist are separated by
either blanks or commas.
-U
userlist-u
userlistdisplays information for processes with user IDs in userlist. Items in userlist can be user ID numbers or login names, and are separated by either blanks or commas.
-o
is a list of names
separated with blanks or commas. At the beginning of the output display,
ps
displays column headings to tell you what you are seeing.
For example, if you specify ruser
(indicating that you want to see
real user names), ps
normally puts the heading
RUSER
at the top of the column that shows real user names.
If you do not specify the -o
option,
ps
displays the information as though you specified
The following list shows the names that-o pid,tty=TTY -o atime,comm=CMD
ps
recognizes.
At the end of each description, we put the default column heading inside square
brackets. The following names are POSIX-compliant.
args
displays the command that is executing, with all its arguments.
[COMMAND]
comm
displays the name of the command that is executing. This string is
padded on the right if necessary. [COMMAND]
etime
displays the amount of real time that has elapsed since the process
began execution. ps
shows the time in the form:
[[dd-]hh:]mm:ss
where dd is the number of days, hh is the number of hours,
mm is the number of minutes, and ss is the number of seconds.
[ELAPSED]
group
displays the effective group ID of the process, as a group name if
possible and as a decimal group ID if not. [GROUP]
nice
displays the nice value (urgency) of the process as a decimal value.
[NI]
pcpu
displays a percentage value giving the ratio of CPU time used to CPU
time available. [%CPU]
pgid
displays the process group ID as a decimal value. [PGID]
pid
displays the process ID as a decimal value. [PID]
ppid
displays the parent process ID as a decimal value. [PPID]
rgroup
displays the real group ID of the process, as a group name if possible
and as a decimal group ID if not. [RGROUP]
ruser
displays the real userid of the process, as a username if possible and
as a decimal user ID otherwise. [RUSER]
time
displays the amount of CPU time that the process has used since it
began execution. ps
displays this time in form similar
to that used by etime
. [TIME]
tty
displays the name of the controlling terminal (if any).
[TT]
user
displays the effective userid of the process, as a username if possible
and as a decimal user ID otherwise. [USER]
vsz
displays the amount of (virtual) memory that the process is using, as
a decimal number of kilobytes. [VSZ]
ps
.
addr
displays the address of the process. [ADDR]
atime
displays the abbreviated CPU time of the process.
[TIME]
flags
displays the process flags. [F]
gid
displays the effective group ID of the process. [EGID]
pri
displays the process priority. [PRI]
rgid
displays the real group ID of the process. [GID]
rss
displays the resident set size of the process. This is the amount of physical memory actually used by the process.
ruid
displays the real user ID of the process. [UID]
sid
displays the session ID of the process. [SID]
state
displays the process state. [S]
stime
displays the start time of the process. [STIME]
uid
displays the effective user ID of the process. [EUID]
wchan
displays the channel upon which the process is waiting.
[WCHAN]
xpid
displays the process ID in hexadecimal.
after the name in the format list. For example,=heading
displays the command and the real user name. The heading for the command column is the defaultps -o args,ruser=WHO
COMMAND
but the heading for the user name column is
WHO
. If you specify =
with no heading,
ps
displays that column without a heading. If all columns
have no heading, ps
displays no heading line.
0
Successful completion.
1
Failure due to any of the following:
2
Usage error, including any of the following:
-o
-c
, -d
, -e
,
-f
, -g
, -l
,
-n
, and -u
options are x/OPEN
extensions to the POSIX standard. The -j
and
-s
options are extensions to both the x/OPEN and
POSIX standards.