1 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)ps.1 8.3 (Berkeley) 4/18/94
29 .\" $FreeBSD: src/bin/ps/ps.1,v 1.24.2.7 2002/06/20 22:43:33 charnier Exp $
30 .\" $DragonFly: src/bin/ps/ps.1,v 1.20 2008/09/02 11:50:45 matthias Exp $
40 .Op Fl aCcefHhjlmrRSTuvwx
54 displays a header line followed by lines containing information about your
55 processes that have controlling terminals.
56 This information is sorted by controlling terminal, then by process ID.
58 The information displayed is selected based on a set of keywords (see the
64 The default output format includes, for each process, the process' ID,
65 controlling terminal, CPU time (including both user and system time),
66 state, and associated command.
68 The process file system (see
70 should be mounted when
72 is executed, otherwise not all information will be available.
74 The options are as follows:
75 .Bl -tag -width indent
77 Display information about other users' processes as well as your own.
78 This can be disabled by setting the
79 .Va security.ps_showallprocs
82 Change the ``command'' column output to just contain the executable name,
83 rather than the full command line.
85 Change the way the CPU percentage is calculated by using a ``raw''
86 CPU calculation that ignores ``resident'' time (this normally has
89 Display the environment as well.
91 Show commandline and environment information about swapped out processes.
92 This option is honored only if the uid of the user is 0.
94 Print one line per lightweight process (LWP) instead of one line per process.
95 When this option is set and the
97 option is not set, the
99 column is inserted in the output format after the
103 Repeat the information header as often as necessary to guarantee one
104 header per page of information.
106 Print information associated with the following keywords:
107 .Cm user , pid , ppid , pgid , sess , jobc , state , tt , time ,
111 List the set of available keywords.
113 Display information associated with the following keywords:
114 .Cm uid , pid , ppid , cpu , pri , nice , vsz , rss , wchan , state ,
119 Extract values associated with the name list from the specified core
120 instead of the default
123 Sort by memory usage, instead of by process ID.
125 Extract the name list from the specified system instead of the default
128 Add the information associated with the space or comma separated list
129 of keywords specified, after the process ID,
130 in the default information
132 Keywords may be appended with an equals (``='') sign and a string.
133 This causes the printed header to use the specified string instead of
136 Display information associated with the space or comma separated list
137 of keywords specified.
138 Keywords may be appended with an equals (``='') sign and a string.
139 This causes the printed header to use the specified string instead of
142 Display information associated with the specified process ID.
144 Sort by current CPU usage, instead of by process ID.
146 Subsort by parent/child chain. This very useful option makes
147 the parent/child associations clear and understandable.
148 If used in combination with
150 then all children of the specified process will be output
151 recursively in addition to the process itself.
153 Change the way the process time is calculated by summing all exited
154 children to their parent process.
156 Display information about processes attached to the device associated
157 with the standard input.
159 Display information about processes attached to the specified terminal
162 Display the processes belonging to the specified
165 Display information associated with the following keywords:
166 .Cm user , pid, %cpu , %mem , vsz , rss , tt , state , start , time ,
175 Display information associated with the following keywords:
176 .Cm pid , state , time , sl , re , pagein , vsz , rss , lim , tsiz ,
186 Use 132 columns to display information, instead of the default which
190 option is specified more than once,
192 will use as many columns as necessary without regard for your window size.
194 Display information about processes without controlling terminals.
197 A complete list of the available keywords are listed below.
198 Some of these keywords are further specified as follows:
199 .Bl -tag -width ".Cm lstart"
201 The CPU utilization of the process; this is a decaying average over up to
202 a minute of previous (real) time.
203 Since the time base over which this is computed varies (since processes may
204 be very young) it is possible for the sum of all
206 fields to exceed 100%.
208 The percentage of real memory used by this process.
210 The flags associated with the process as in
214 The soft limit on memory used, specified via a call to
217 The exact time the command started, using the ``%c'' format described in
220 The process scheduling increment (see
221 .Xr setpriority 2 ) .
223 the real memory (resident set) size of the process (in 1024 byte units).
225 The time the command started.
226 If the command started less than 24 hours ago, the start time is
227 displayed using the ``%l:ps.1p'' format described in
229 If the command started less than 7 days ago, the start time is
230 displayed using the ``%a6.15p'' format.
231 Otherwise, the start time is displayed using the ``%e%b%y'' format.
233 The state is given by a sequence of letters, for example,
235 The first letter indicates the run state of the process:
237 .Bl -tag -width indent -compact
239 Marks a blocked kernel thread.
241 Marks a process in disk (or other short term, uninterruptible) wait.
243 Marks a process that is idle (sleeping for longer than about 20 seconds).
245 Marks a process which is in
247 The hostname of the prison can be found in
248 .Pa /proc/ Ns Ao Ar pid Ac Ns Pa /status .
250 Marks a runnable process and is followed by the CPU number.
252 Marks a process that is sleeping for less than about 20 seconds.
254 Marks a stopped process.
256 Marks a dead process (a
260 Additional characters after these, if any, indicate additional state
263 .Bl -tag -width indent -compact
265 The process is in the foreground process group of its control terminal.
267 The process has raised CPU scheduling priority.
269 The process has specified a soft limit on memory requirements and is
270 currently exceeding that limit; such a process is (necessarily) not
273 the process has asked for random page replacement
274 .Pf ( Dv MADV_RANDOM ,
279 in a garbage collect).
281 The process is trying to exit.
283 The process has pages locked in core (for example, for raw
286 This flag is deprecated. It used to indicate that the
287 process or thread was not holding the MP lock (the Big Giant Lock),
288 but since that is the usual case now it just clutters the
291 The process has reduced CPU scheduling priority (see
292 .Xr setpriority 2 ) .
294 The process has asked for FIFO page replacement
295 .Pf ( Dv MADV_SEQUENTIAL ,
298 for example, a large image processing program using virtual memory to
299 sequentially address voluminous data).
301 The process is a session leader.
303 The process is suspended during a
306 The process is swapped out.
308 The process is being traced or debugged.
311 An abbreviation for the pathname of the controlling terminal, if any.
312 The abbreviation consists of the three letters following
314 or, for the console, ``con''.
315 This is followed by a ``-'' if the process can no longer reach that
316 controlling terminal (i.e., it has been revoked).
318 The event (an address in the system) on which a process waits.
319 When printed numerically, the initial part of the address is
320 trimmed off and the result is printed in hex, for example, 0x80324000 prints
321 as 324000. Note that blocked threads often only have ascii wchan's.
324 When printing using the
326 keyword, a process that has exited and
327 has a parent that has not yet waited for the process (in other words, a zombie)
328 is listed as ``<defunct>'', and a process which is blocked while trying
329 to exit is listed as ``<exiting>''.
333 makes an educated guess as to the file name and arguments given when the
334 process was created by examining memory or the swap area.
335 The method is inherently somewhat unreliable and in any event a process
336 is entitled to destroy this information, so the names cannot be depended
340 (accounting) keyword can, however, be depended on.
342 The following is a complete list of the available keywords and their
344 Several of them have aliases (keywords which are synonyms).
346 .Bl -tag -width ".Cm sigignore" -compact
348 percentage CPU usage (alias
351 percentage memory usage (alias
354 accounting flag (alias
357 batchness of the process (higher numbers mean less interactivity)
359 command and arguments
361 short-term CPU usage factor (for scheduling)
363 the process flags, in hexadecimal (alias
366 total blocks read (alias
377 CPU ID the process was last scheduled on
381 login name of user who started the process (alias
390 total messages received (reads from pipes/sockets)
392 total messages sent (writes on pipes/sockets)
397 total involuntary context switches
399 number of lightweight processes
401 total signals taken (alias
406 total voluntary context switches
408 wait channel (as an address)
410 total blocks written (alias
413 resource usage (valid only for zombie)
426 scheduling priority (lower == better)
428 core residency time (in seconds; 127 = infinity)
432 .\" reverse link on run queue, or 0
436 resident set size + (text size / text use count) (alias
439 realtime priority (101 = not a realtime process)
443 user name (from ruid)
447 pending signals (alias
450 caught signals (alias
453 ignored signals (alias
456 blocked signals (alias
459 sleep time (in seconds; 127 = infinity)
463 symbolic process state (alias
466 saved gid from a setgid executable
468 saved uid from a setuid executable
470 control terminal device number
472 LWKT thread priority (0-31, 31 highest), and critical section count
474 thread ID (aka lightweight process ID)
476 accumulated CPU time, user + system (alias
479 control terminal process group ID
481 .\"text resident set size (in Kbytes)
483 control terminal session pointer
485 pending thread signals
487 text size (in Kbytes)
489 control terminal name (two letter abbreviation)
491 full name of control terminal
493 name to be used for accounting (alias
500 virtual size in Kbytes (alias
503 wait channel (as a symbolic name)
505 exit or stop status (valid only for stopped or zombie process)
508 .Bl -tag -width /var/db/kvm_kernel.db -compact
510 default kernel memory
511 .It Pa /var/run/dev.db
513 .It Pa /var/db/kvm_kernel.db
514 system namelist database
516 default system namelist
537 cannot run faster than the system and is run as any other scheduled
538 process, the information it displays can never be exact.