Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
ps(1)
Edit
PageHistory
Diff
Info
LikePages
PS !!!PS NAME SYNOPSIS DESCRIPTION OPTIONS NOTES SORT KEYS AIX FORMAT DESCRIPTORS STANDARD FORMAT SPECIFIERS ENVIRONMENT VARIABLES EXAMPLES CONFORMING TO AUTHOR SEE ALSO ---- !!NAME __ps__ - report process status !!SYNOPSIS __ps__ [[''options''] !!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. !!OPTIONS This version of __ps__ accepts several kinds of options. Unix options may be grouped and must be preceeded by a dash. BSD options may be grouped and must not be used with a dash. GNU long options are preceeded by two dashes. Options of different types may be freely mixed. Set the __I_WANT_A_BROKEN_PS__ environment variable to force BSD syntax even when options are preceeded by a dash. The __PS_PERSONALITY__ environment variable (described below) provides more detailed control of ps behavior. SIMPLE PROCESS SELECTION PROCESS SELECTION BY LIST OUTPUT FORMAT CONTROL OUTPUT MODIFIERS INFORMATION OBSOLETE !!NOTES The __-g__ option can select by session leader OR by group name. Selection by session leader is specified by many standards, but selection by group is the logical behavior that several other operating systems use. This ps will select by session leader when the list is completely numeric (as sessions are). Group ID numbers will work only when some group names are also specified. The __m__ option should not be used. Use __-m__ or __-o__ with a list. (__m__ displays memory info, shows threads, or sorts by memory use) The __h__ option is problematic. Standard BSD __ps__ uses the option to print a header on each page of output, but older Linux __ps__ uses the option to totally disable the header. This version of ps follows the Linux usage of not printing the header unless the BSD personality has been selected, in which case it prints a header on each page of output. Regardless of the current personality, you can use the long options __--headers__ and __--no-headers__ to enable printing headers each page and disable headers entirely, respectively. Terminals (ttys, or screens for text output) can be specified in several forms: ''/dev/ttyS1'', ''ttyS1'', ''S1''. Obsolete __ps t__ (your own terminal) and __ps t?__ (processes without a terminal) syntax is supported, but modern options (__T__, __-t__ with list, __x__, __t__ with list) should be used instead. The BSD __O__ option can act like __-O__ (user-defined output format with some common fields predefined) or can be used to specify sort order. Heuristics are used to determine the behavior of this option. To ensure that the desired behavior is obtained, specify the other option (sorting or formatting) in some other way. For sorting, BSD __O__ option syntax is __O__[[+|-]''k1''[[,[[+|-]''k2''[[,...]] Order the process listing according to the multilevel sort specified by the sequence of short keys from SORT KEYS, ''k1'', ''k2'', ... The `+' is quite optional, merely re-iterating the default direction on a key. `-' reverses direction only on the key it precedes. The __O__ option must be the last option in a single command argument, but specifications in successive arguments are catenated. GNU sorting syntax is __--sort__''X''[[+|-]''key''[[,[[+|-]''key''[[,...]] Choose a multi-letter key from the SORT KEYS section. X may be any convenient separator character. To be GNU-ish use `='. The `+' is really optional since default direction is increasing numerical or lexicographic order. For example, __ps__ ''jax'' __--sort__=''uid'',-''ppid'',+''pid'' This __ps__ works by reading the virtual files in /proc. This __ps__ does not need to be suid kmem or have any privileges to run. Do not give this __ps__ any special permissions. This __ps__ needs access to a namelist file for proper WCHAN display. The namelist file must match the current Linux kernel exactly for correct output. To produce the WCHAN field, ps needs to read the System.map file created when the kernel is compiled. The search path is: __$PS_SYSTEM_MAP__'' /boot/System.map-`uname -r` /boot/System.map /lib/modules/`uname -r`/System.map /usr/src/linux/System.map'' The member used_math of task_struct is not shown, since crt0.s checks to see if math is present. This causes the math flag to be set for all processes, and so it is worthless. (Somebody fix libc or the kernel please) Programs swapped out to disk will be shown without command line arguments, and unless the __c__ option is given, in brackets. %CPU shows the cputime/realtime percentage. It will not add up to 100% unless you are lucky. It is time used divided by the time the process has been running. The SIZE and RSS fields don't count the page tables and the task_struct of a proc; this is at least 12k of memory that is always resident. SIZE is the virtual size of the proc (code+data+stack). Processes marked init__(8) if the parent process exits. PROCESS FLAGS PROCESS STATE CODES For BSD formats and when the !!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. Pipe ps output into the sort(1) command if you want to sort the cooked values. !!AIX FORMAT DESCRIPTORS This ps supports AIX format descriptors, which work somewhat like the formatting codes of printf(1) and printf(3). For example, the normal default output can be produced with this: __ps -eo__ __ !!STANDARD FORMAT SPECIFIERS These may be used to control both output format and sorting. For example: ps -eo pid,user,args --sort user !!ENVIRONMENT VARIABLES The following environment variables could affect ps: In general, it is a bad idea to set these variables. The one exception is __CMD_ENV__ or __PS_PERSONALITY__, which could be set to Linux for normal systems. Without that setting, __ps__ follows the useless and bad parts of the Unix98 standard. PERSONALITY !!EXAMPLES To see every process on the system using standard syntax: __ps -e__ To see every process on the system using BSD syntax: __ps ax__ To see every process except those running as root (real ps -U__ ''root'' __-u__ ''root'' __-N__ To see every process with a user-defined format: __ps -eo__ pid,tt,user,fname,tmout,f,wchan Odd display with AIX field descriptors: __ps -o__ __ Print only the process IDs of syslogd: __ps -C__ ''syslogd'' __-o__ pid= !!CONFORMING TO This __ps__ conforms to version 2 of the Single Unix Specification. !!AUTHOR ps was originally written by Branko Lankester ps__ for full Unix98 and BSD support, along with some ugly hacks for obsolete and foreign syntax. Please send bug reports to !!SEE ALSO top(1), pstree(1), proc(5) ----
33 pages link to
ps(1)
:
SharedLibrary
Zombie
PerlOneLiners
nsupdate(8)
pbmtoepsi(1)
tcpdump(8)
perlvar(1)
MemoryThrashing
dig(1)
free(1)
funzip(1)
fuser(1)
killall(1)
login.defs(5)
pgrep(1)
pkill(1)
pstree(1)
lsof(8)
tload(1)
top(1)
uptime(1)
vmstat(8)
w(1)
w.procps(1)
proc(5)
mdoc.samples(7)
Man1p
ptrace(2)
groff_mdoc(7)
TwoLetterCommands
init(8)
KernelSpace
ProcessUtilities
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.