NAME
ps—Report process status
SYNOPSIS
ps [–][lujsvmaxScewhrnu][txx][O[+|-]k1[[+|-]k2…]] [pids]
There are also two long options:
–sortX[+|-]key[,[+|-]key[,…]]
–help
More long options are on the way…
DESCRIPTION
ps gives a snapshot of the current processes. If you want a repetitive update of this status, use top. This man page documents the /proc-based version of ps, or tries to.
COMMAND-LINE OPTIONS
Command-line arguments may optionally be preceded by a –, but there is no need for it. There are also some long options in GNU style; see the following subsection for those.
Options | Description |
l | Long format. |
u | User format: gives username and start time. |
j | Jobs format: pgid sid. |
s | Signal format. |
v | vm format. |
m | Displays memory information (combine with p flag to get number of pages). |
f | Forest family tree format for command line. |
a | Show processes of other users too. |
x | Show processes without controlling terminal. |
S | Add child cpu time and page faults. |
c | Command name from task struct. |
e | Show environment after command line and +. |
w | Wide output: don’t truncate command lines to fit on one line. |
h | No header. |
r | Running procs only. |
n | Numeric output for USER and WCHAN. |
txx | Only procs with controlling tty xx; use for xx the same letters as shown in the TT field. The tty name must be given immediately after the option, with no intervening space, for example, ps -tv1. |
O[+|-]k1[,[+|-]k2[,…]] | Order the process listing according to the multilevel sort specified by the sequence of short keys from SORT KEYS, k1, k2, …. Default order specifications exist for each of the various formats of ps. These are overridden by a user-specified ordering. The + is quite optional, merely reiterating the default direction on a key. – reverses direction only on the key it precedes. As with t and pids, the O option must be the last option in a single command argument, but specifications in successive arguments are catenated. |
pids | List only the specified processes; they are comma-delimited. The list must be given immediately after the last option in a single command-line argument, with no intervening space, for example, ps -j1,4,5. Lists specified in subsequent arguments are catenated, for example, ps -l1,23,4 5 6 will list all of the processes 1-6 in long format. |
SORT KEYS
Note that the values used in sorting are the internal values ps uses and not the “cooked” values used in some of the output format fields. If someone wants to volunteer to write special comparison functions for the cooked values,…;-)
Options | Long | Description |
c | cmd | Simple name of executable |
C | cmdline | Full command line |
f | flags | Flags as in long format F field |
g | pgrp | Process group ID |
G | tpgid | Controlling tty process group ID |
j | cutime | Cumulative user time |
J | cstime | Cumulative system time |
k | utime | User time |
K | stime | System time |
m | min_flt | Number of minor page faults |
M | maj_flt | Number of major page faults |
n | cmin_flt | Cumulative minor page faults |
N | cmaj_flt | Cumulative major page faults |
o | session | Session ID |
p | pid | Process ID |
P | ppid | Parent process ID |
r | rss | Resident set size |
R | resident | Resident pages |
s | size | Memory size in kilobytes |
S | share | Amount of shared pages |
t | tty | The minor device number of tty |
T | start_time | Time process was started |
U | uid | User ID number |
u | user | Username |
v | vsize | Total VM size in bytes |
y | priority | Kernel scheduling priority |
FIELD DESCRIPTIONS
Field | Description |
PRI | This is the counter field in the task struct. It is the time in HZ of the process’s possible time slice. |
NI | Standard UNIX nice value; a positive value means less cpu time. |
SIZE | Virtual image size; size of text+data+stack. |
RSS | Resident set size; kilobytes of program in memory. |
WCHAN | Name of the kernel function where the process is sleeping, with the sys stripped from the function name. If /boot/psdatabase does not exist, it is just a hex number instead. |
STAT | Information about the status of the process. The first field is R for runnable, S for sleeping, D for uninterruptible sleep, T for stopped or traced, or Z for a zombie process. The second field contains W if the process has no resident pages. The third field is N if the process has a positive nice value (NI field). |
TT | Controlling tty. |
PAGEIN | Number of major page faults (page faults that cause pages to be read from disk, including pages read from the buffer cache). |
TRS | Text resident size. |
SWAP | Kilobytes (or pages if –p is used) on swap device. |
SHARE | Shared memory. |
0 Comments