Penguin
Annotated edit history of ps(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 PS
2 !!!PS
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 NOTES
8 SORT KEYS
9 AIX FORMAT DESCRIPTORS
10 STANDARD FORMAT SPECIFIERS
11 ENVIRONMENT VARIABLES
12 EXAMPLES
13 CONFORMING TO
14 AUTHOR
15 SEE ALSO
16 ----
17 !!NAME
18
19
20 __ps__ - report process status
21 !!SYNOPSIS
22
23
24 __ps__ [[''options'']
25 !!DESCRIPTION
26
27
28 __ps__ gives a snapshot of the current processes. If you
29 want a repetitive update of this status, use __top__.
30 This man page documents the /proc-based version of
31 __ps__, or tries to.
32 !!OPTIONS
33
34
35 This version of __ps__ accepts several kinds of
36 options.
37
38
39 Unix options may be grouped and must be preceeded by a dash.
40 BSD options may be grouped and must not be used with a dash.
41 GNU long options are preceeded by two dashes.
42
43
44 Options of different types may be freely mixed.
45
46
47 Set the __I_WANT_A_BROKEN_PS__ environment variable to
48 force BSD syntax even when options are preceeded by a dash.
49 The __PS_PERSONALITY__ environment variable (described
50 below) provides more detailed control of ps
51 behavior.
52
53
54 SIMPLE PROCESS SELECTION
55
56
57 PROCESS SELECTION BY LIST
58
59
60 OUTPUT FORMAT CONTROL
61
62
63 OUTPUT MODIFIERS
64
65
66 INFORMATION
67
68
69 OBSOLETE
70 !!NOTES
71
72
73 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.
74
75
76 The __m__ option should not be used. Use __-m__ or
77 __-o__ with a list. (__m__ displays memory info, shows
78 threads, or sorts by memory use)
79
80
81 The __h__ option is problematic. Standard BSD __ps__
82 uses the option to print a header on each page of output,
83 but older Linux __ps__ uses the option to totally disable
84 the header. This version of ps follows the Linux usage of
85 not printing the header unless the BSD personality has been
86 selected, in which case it prints a header on each page of
87 output. Regardless of the current personality, you can use
88 the long options __--headers__ and __--no-headers__ to
89 enable printing headers each page and disable headers
90 entirely, respectively.
91
92
93 Terminals (ttys, or screens for text output) can be
94 specified in several forms: ''/dev/ttyS1'', ''ttyS1'',
95 ''S1''. Obsolete __ps t__ (your own terminal) and
96 __ps t?__ (processes without a terminal) syntax is
97 supported, but modern options (__T__, __-t__ with
98 list, __x__, __t__ with list) should be used
99 instead.
100
101
102 The BSD __O__ option can act like __-O__ (user-defined
103 output format with some common fields predefined) or can be
104 used to specify sort order. Heuristics are used to determine
105 the behavior of this option. To ensure that the desired
106 behavior is obtained, specify the other option (sorting or
107 formatting) in some other way.
108
109
110 For sorting, BSD __O__ option syntax is
111 __O__[[+|-]''k1''[[,[[+|-]''k2''[[,...]] Order the
112 process listing according to the multilevel sort specified
113 by the sequence of short keys from SORT KEYS, ''k1'',
114 ''k2'', ... The `+' is quite optional, merely
115 re-iterating the default direction on a key. `-' reverses
116 direction only on the key it precedes. The __O__ option
117 must be the last option in a single command argument, but
118 specifications in successive arguments are
119 catenated.
120
121
122 GNU sorting syntax is
123 __--sort__''X''[[+|-]''key''[[,[[+|-]''key''[[,...]]
124 Choose a multi-letter key from the SORT KEYS section. X may
125 be any convenient separator character. To be GNU-ish use
126 `='. The `+' is really optional since default direction is
127 increasing numerical or lexicographic order. For example,
128 __ps__ ''jax''
129 __--sort__=''uid'',-''ppid'',+''pid''
130
131
132 This __ps__ works by reading the virtual files in /proc.
133 This __ps__ does not need to be suid kmem or have any
134 privileges to run. Do not give this __ps__ any special
135 permissions.
136
137
138 This __ps__ needs access to a namelist file for proper
139 WCHAN display. The namelist file must match the current
140 Linux kernel exactly for correct output.
141
142
143 To produce the WCHAN field, ps needs to read the System.map
144 file created when the kernel is compiled. The search path
145 is:
146
147
148 __$PS_SYSTEM_MAP__''
149 /boot/System.map-`uname -r`
150 /boot/System.map
151 /lib/modules/`uname -r`/System.map
152 /usr/src/linux/System.map''
153
154
155 The member used_math of task_struct is not shown, since
156 crt0.s checks to see if math is present. This causes the
157 math flag to be set for all processes, and so it is
158 worthless. (Somebody fix libc or the kernel
159 please)
160
161
162 Programs swapped out to disk will be shown without command
163 line arguments, and unless the __c__ option is given, in
164 brackets.
165
166
167 %CPU shows the cputime/realtime percentage. It will not add
168 up to 100% unless you are lucky. It is time used divided by
169 the time the process has been running.
170
171
172 The SIZE and RSS fields don't count the page tables and the
173 task_struct of a proc; this is at least 12k of memory that
174 is always resident. SIZE is the virtual size of the proc
175 (code+data+stack).
176
177
178 Processes marked
179 init__(8) if the parent process
180 exits.
181
182
183 PROCESS FLAGS
184
185
186 PROCESS STATE CODES
187
188
189 For BSD formats and when the
190 !!SORT KEYS
191
192
193 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.
194 !!AIX FORMAT DESCRIPTORS
195
196
197 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__ __
198 !!STANDARD FORMAT SPECIFIERS
199
200
201 These may be used to control both output format and sorting. For example: ps -eo pid,user,args --sort user
202 !!ENVIRONMENT VARIABLES
203
204
205 The following environment variables could affect ps:
206
207
208 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.
209
210
211 PERSONALITY
212 !!EXAMPLES
213
214
215 To see every process on the system using standard syntax: __ps -e__
216 To see every process on the system using BSD syntax: __ps ax__
217 To see every process except those running as root (real ps -U__ ''root'' __-u__ ''root'' __-N__
218 To see every process with a user-defined format: __ps -eo__ pid,tt,user,fname,tmout,f,wchan
219 Odd display with AIX field descriptors: __ps -o__ __
220 Print only the process IDs of syslogd: __ps -C__ ''syslogd'' __-o__ pid=
221 !!CONFORMING TO
222
223
224 This __ps__ conforms to version 2 of the Single Unix
225 Specification.
226 !!AUTHOR
227
228
229 ps was originally written by Branko Lankester
230 ps__ for full
231 Unix98 and BSD support, along with some ugly hacks for
232 obsolete and foreign syntax.
233
234
235 Please send bug reports to
236 !!SEE ALSO
237
238
239 top(1), pstree(1), proc(5)
240 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.