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 $
39 .Op Fl aCcefHhjlmrRSTuvwx
53 displays a header line followed by lines containing information about your
54 processes that have controlling terminals.
55 This information is sorted by controlling terminal, then by process ID.
57 The information displayed is selected based on a set of keywords (see the
63 The default output format includes, for each process, the process' ID,
64 controlling terminal, CPU time (including both user and system time),
65 state, and associated command.
67 The process file system (see
69 should be mounted when
71 is executed, otherwise not all information will be available.
73 The options are as follows:
74 .Bl -tag -width indent
76 Display information about other users' processes as well as your own.
77 This can be disabled by setting the
78 .Va security.ps_showallprocs
81 Change the ``command'' column output to just contain the executable name,
82 rather than the full command line.
84 Change the way the CPU percentage is calculated by using a ``raw''
85 CPU calculation that ignores ``resident'' time (this normally has
88 Display the environment as well.
90 Show commandline and environment information about swapped out processes.
91 This option is honored only if the uid of the user is 0.
93 Print one line per lightweight process (LWP) instead of one line per process.
94 When this option is set and the
96 option is not set, the
98 column is inserted in the output format after the
102 Repeat the information header as often as necessary to guarantee one
103 header per page of information.
105 Print information associated with the following keywords:
106 .Cm user , pid , ppid , pgid , sess , jobc , state , tt , time ,
110 List the set of available keywords.
112 Display information associated with the following keywords:
113 .Cm uid , pid , ppid , cpu , pri , nice , vsz , rss , wchan , state ,
118 Extract values associated with the name list from the specified core
119 instead of the default
122 Sort by memory usage, instead of by process ID.
124 Extract the name list from the specified system instead of the default
127 Add the information associated with the space or comma separated list
128 of keywords specified, after the process ID,
129 in the default information
131 Keywords may be appended with an equals (``='') sign and a string.
132 This causes the printed header to use the specified string instead of
135 Display information associated with the space or comma separated list
136 of keywords specified.
137 Keywords may be appended with an equals (``='') sign and a string.
138 This causes the printed header to use the specified string instead of
141 Display information associated with the specified process ID.
143 Sort by current CPU usage, instead of by process ID.
145 Subsort by parent/child chain. This very useful option makes
146 the parent/child associations clear and understandable.
147 If used in combination with
149 then all children of the specified process will be output
150 recursively in addition to the process itself.
152 Change the way the process time is calculated by summing all exited
153 children to their parent process.
155 Display information about processes attached to the device associated
156 with the standard input.
158 Display information about processes attached to the specified terminal
161 Display the processes belonging to the specified
164 Display information associated with the following keywords:
165 .Cm user , pid, %cpu , %mem , vsz , rss , tt , state , start , time ,
174 Display information associated with the following keywords:
175 .Cm pid , state , time , sl , re , pagein , vsz , rss , lim , tsiz ,
185 Use 132 columns to display information, instead of the default which
189 option is specified more than once,
191 will use as many columns as necessary without regard for your window size.
193 Display information about processes without controlling terminals.
196 A complete list of the available keywords are listed below.
197 Some of these keywords are further specified as follows:
198 .Bl -tag -width ".Cm lstart"
200 The CPU utilization of the process; this is a decaying average over up to
201 a minute of previous (real) time.
202 Since the time base over which this is computed varies (since processes may
203 be very young) it is possible for the sum of all
205 fields to exceed 100%.
207 The percentage of real memory used by this process.
209 The flags associated with the process as in
213 The soft limit on memory used, specified via a call to
216 The exact time the command started, using the ``%c'' format described in
219 The process scheduling increment (see
220 .Xr setpriority 2 ) .
222 the real memory (resident set) size of the process (in 1024 byte units).
224 The time the command started.
225 If the command started less than 24 hours ago, the start time is
226 displayed using the ``%l:ps.1p'' format described in
228 If the command started less than 7 days ago, the start time is
229 displayed using the ``%a6.15p'' format.
230 Otherwise, the start time is displayed using the ``%e%b%y'' format.
232 The state is given by a sequence of letters, for example,
234 The first letter indicates the run state of the process:
236 .Bl -tag -width indent -compact
238 Marks a blocked kernel thread.
240 Marks a process in disk (or other short term, uninterruptible) wait.
242 Marks a process that is idle (sleeping for longer than about 20 seconds).
244 Marks a process which is in
246 The hostname of the prison can be found in
247 .Pa /proc/ Ns Ao Ar pid Ac Ns Pa /status .
249 Marks a runnable process and is followed by the CPU number.
251 Marks a process that is sleeping for less than about 20 seconds.
253 Marks a stopped process.
255 Marks a dead process (a
259 Additional characters after these, if any, indicate additional state
262 .Bl -tag -width indent -compact
264 The process is in the foreground process group of its control terminal.
266 The process has raised CPU scheduling priority.
268 The process has specified a soft limit on memory requirements and is
269 currently exceeding that limit; such a process is (necessarily) not
272 the process has asked for random page replacement
273 .Pf ( Dv MADV_RANDOM ,
278 in a garbage collect).
280 The process is trying to exit.
282 The process has pages locked in core (for example, for raw
285 The process has reduced CPU scheduling priority (see
286 .Xr setpriority 2 ) .
288 The process has asked for FIFO page replacement
289 .Pf ( Dv MADV_SEQUENTIAL ,
292 for example, a large image processing program using virtual memory to
293 sequentially address voluminous data).
295 The process is a session leader.
297 The process is suspended during a
300 The process is swapped out.
302 The process is being traced or debugged.
305 An abbreviation for the pathname of the controlling terminal, if any.
306 The abbreviation consists of the three letters following
308 or, for the console, ``con''.
309 This is followed by a ``-'' if the process can no longer reach that
310 controlling terminal (i.e., it has been revoked).
312 The event (an address in the system) on which a process waits.
313 When printed numerically, the initial part of the address is
314 trimmed off and the result is printed in hex, for example, 0x80324000 prints
315 as 324000. Note that blocked threads often only have ascii wchan's.
318 When printing using the
320 keyword, a process that has exited and
321 has a parent that has not yet waited for the process (in other words, a zombie)
322 is listed as ``<defunct>'', and a process which is blocked while trying
323 to exit is listed as ``<exiting>''.
327 makes an educated guess as to the file name and arguments given when the
328 process was created by examining memory or the swap area.
329 The method is inherently somewhat unreliable and in any event a process
330 is entitled to destroy this information, so the names cannot be depended
334 (accounting) keyword can, however, be depended on.
336 The following is a complete list of the available keywords and their
338 Several of them have aliases (keywords which are synonyms).
340 .Bl -tag -width ".Cm sigignore" -compact
342 percentage CPU usage (alias
345 percentage memory usage (alias
348 accounting flag (alias
351 batchness of the process (higher numbers mean less interactivity)
353 command and arguments
355 short-term CPU usage factor (for scheduling)
357 the process flags, in hexadecimal (alias
360 total blocks read (alias
371 CPU ID the process was last scheduled on
375 login name of user who started the process (alias
384 total messages received (reads from pipes/sockets)
386 total messages sent (writes on pipes/sockets)
391 total involuntary context switches
393 number of lightweight processes
395 total signals taken (alias
400 total voluntary context switches
402 wait channel (as an address)
404 total blocks written (alias
407 resource usage (valid only for zombie)
420 scheduling priority (lower == better)
422 core residency time (in seconds; 127 = infinity)
426 .\" reverse link on run queue, or 0
430 resident set size + (text size / text use count) (alias
433 realtime priority (101 = not a realtime process)
437 user name (from ruid)
441 pending signals (alias
444 caught signals (alias
447 ignored signals (alias
450 blocked signals (alias
453 sleep time (in seconds; 127 = infinity)
457 symbolic process state (alias
460 saved gid from a setgid executable
462 saved uid from a setuid executable
464 control terminal device number
466 LWKT thread priority (0-31, 31 highest), and critical section count
468 thread ID (aka lightweight process ID)
470 accumulated CPU time, user + system (alias
473 control terminal process group ID
475 .\"text resident set size (in Kbytes)
477 control terminal session pointer
479 pending thread signals
481 text size (in Kbytes)
483 control terminal name (two letter abbreviation)
485 full name of control terminal
487 name to be used for accounting (alias
494 virtual size in Kbytes (alias
497 wait channel (as a symbolic name)
499 exit or stop status (valid only for stopped or zombie process)
502 .Bl -tag -width /var/db/kvm_kernel.db -compact
504 default kernel memory
505 .It Pa /var/run/dev.db
507 .It Pa /var/db/kvm_kernel.db
508 system namelist database
510 default system namelist
531 cannot run faster than the system and is run as any other scheduled
532 process, the information it displays can never be exact.