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. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)ps.1 8.3 (Berkeley) 4/18/94
33 .\" $FreeBSD: src/bin/ps/ps.1,v 1.24.2.7 2002/06/20 22:43:33 charnier Exp $
34 .\" $DragonFly: src/bin/ps/ps.1,v 1.19 2008/01/04 12:31:45 matthias Exp $
44 .Op Fl aCcefHhjlmrSTuvwx
58 displays a header line followed by lines containing information about your
59 processes that have controlling terminals.
60 This information is sorted by controlling terminal, then by process ID.
62 The information displayed is selected based on a set of keywords (see the
68 The default output format includes, for each process, the process' ID,
69 controlling terminal, CPU time (including both user and system time),
70 state, and associated command.
72 The process file system (see
74 should be mounted when
76 is executed, otherwise not all information will be available.
78 The options are as follows:
79 .Bl -tag -width indent
81 Display information about other users' processes as well as your own.
82 This can be disabled by setting the
83 .Va security.ps_showallprocs
86 Change the ``command'' column output to just contain the executable name,
87 rather than the full command line.
89 Change the way the CPU percentage is calculated by using a ``raw''
90 CPU calculation that ignores ``resident'' time (this normally has
93 Display the environment as well.
95 Show commandline and environment information about swapped out processes.
96 This option is honored only if the uid of the user is 0.
98 Print one line per lightweight process (LWP) instead of one line per process.
99 When this option is set and the
101 option is not set, the
103 column is inserted in the output format after the
107 Repeat the information header as often as necessary to guarantee one
108 header per page of information.
110 Print information associated with the following keywords:
111 .Cm user , pid , ppid , pgid , sess , jobc , state , tt , time ,
115 List the set of available keywords.
117 Display information associated with the following keywords:
118 .Cm uid , pid , ppid , cpu , pri , nice , vsz , rss , wchan , state ,
123 Extract values associated with the name list from the specified core
124 instead of the default
127 Sort by memory usage, instead of by process ID.
129 Extract the name list from the specified system instead of the default
132 Add the information associated with the space or comma separated list
133 of keywords specified, after the process ID,
134 in the default information
136 Keywords may be appended with an equals (``='') sign and a string.
137 This causes the printed header to use the specified string instead of
140 Display information associated with the space or comma separated list
141 of keywords specified.
142 Keywords may be appended with an equals (``='') sign and a string.
143 This causes the printed header to use the specified string instead of
146 Display information associated with the specified process ID.
148 Sort by current CPU usage, instead of by process ID.
150 Change the way the process time is calculated by summing all exited
151 children to their parent process.
153 Display information about processes attached to the device associated
154 with the standard input.
156 Display information about processes attached to the specified terminal
159 Display the processes belonging to the specified
162 Display information associated with the following keywords:
163 .Cm user , pid, %cpu , %mem , vsz , rss , tt , state , start , time ,
172 Display information associated with the following keywords:
173 .Cm pid , state , time , sl , re , pagein , vsz , rss , lim , tsiz ,
183 Use 132 columns to display information, instead of the default which
187 option is specified more than once,
189 will use as many columns as necessary without regard for your window size.
191 Display information about processes without controlling terminals.
194 A complete list of the available keywords are listed below.
195 Some of these keywords are further specified as follows:
196 .Bl -tag -width ".Cm lstart"
198 The CPU utilization of the process; this is a decaying average over up to
199 a minute of previous (real) time.
200 Since the time base over which this is computed varies (since processes may
201 be very young) it is possible for the sum of all
203 fields to exceed 100%.
205 The percentage of real memory used by this process.
207 The flags associated with the process as in
211 The soft limit on memory used, specified via a call to
214 The exact time the command started, using the ``%c'' format described in
217 The process scheduling increment (see
218 .Xr setpriority 2 ) .
220 the real memory (resident set) size of the process (in 1024 byte units).
222 The time the command started.
223 If the command started less than 24 hours ago, the start time is
224 displayed using the ``%l:ps.1p'' format described in
226 If the command started less than 7 days ago, the start time is
227 displayed using the ``%a6.15p'' format.
228 Otherwise, the start time is displayed using the ``%e%b%y'' format.
230 The state is given by a sequence of letters, for example,
232 The first letter indicates the run state of the process:
234 .Bl -tag -width indent -compact
236 Marks a blocked kernel thread.
238 Marks a process in disk (or other short term, uninterruptible) wait.
240 Marks a process that is idle (sleeping for longer than about 20 seconds).
242 Marks a process which is in
244 The hostname of the prison can be found in
245 .Pa /proc/ Ns Ao Ar pid Ac Ns Pa /status .
247 Marks a runnable process and is followed by the CPU number.
249 Marks a process that is sleeping for less than about 20 seconds.
251 Marks a stopped process.
253 Marks a dead process (a
257 Additional characters after these, if any, indicate additional state
260 .Bl -tag -width indent -compact
262 The process is in the foreground process group of its control terminal.
264 The process has raised CPU scheduling priority.
266 The process has specified a soft limit on memory requirements and is
267 currently exceeding that limit; such a process is (necessarily) not
270 the process has asked for random page replacement
271 .Pf ( Dv MADV_RANDOM ,
276 in a garbage collect).
278 The process is trying to exit.
280 The process has pages locked in core (for example, for raw
283 On SMP systems indicates a process or thread which is
285 holding the MP lock (the Big Giant Lock).
287 The process has reduced CPU scheduling priority (see
288 .Xr setpriority 2 ) .
290 The process has asked for FIFO page replacement
291 .Pf ( Dv MADV_SEQUENTIAL ,
294 for example, a large image processing program using virtual memory to
295 sequentially address voluminous data).
297 The process is a session leader.
299 The process is suspended during a
302 The process is swapped out.
304 The process is being traced or debugged.
307 An abbreviation for the pathname of the controlling terminal, if any.
308 The abbreviation consists of the three letters following
310 or, for the console, ``con''.
311 This is followed by a ``-'' if the process can no longer reach that
312 controlling terminal (i.e., it has been revoked).
314 The event (an address in the system) on which a process waits.
315 When printed numerically, the initial part of the address is
316 trimmed off and the result is printed in hex, for example, 0x80324000 prints
317 as 324000. Note that blocked threads often only have ascii wchan's.
320 When printing using the
322 keyword, a process that has exited and
323 has a parent that has not yet waited for the process (in other words, a zombie)
324 is listed as ``<defunct>'', and a process which is blocked while trying
325 to exit is listed as ``<exiting>''.
329 makes an educated guess as to the file name and arguments given when the
330 process was created by examining memory or the swap area.
331 The method is inherently somewhat unreliable and in any event a process
332 is entitled to destroy this information, so the names cannot be depended
336 (accounting) keyword can, however, be depended on.
338 The following is a complete list of the available keywords and their
340 Several of them have aliases (keywords which are synonyms).
342 .Bl -tag -width ".Cm sigignore" -compact
344 percentage CPU usage (alias
347 percentage memory usage (alias
350 accounting flag (alias
353 batchness of the process (higher numbers mean less interactivity)
355 command and arguments
357 short-term CPU usage factor (for scheduling)
359 the process flags, in hexadecimal (alias
362 total blocks read (alias
373 CPU ID the process was last scheduled on
377 login name of user who started the process (alias
386 total messages received (reads from pipes/sockets)
388 total messages sent (writes on pipes/sockets)
393 total involuntary context switches
395 number of lightweight processes
397 total signals taken (alias
402 total voluntary context switches
404 wait channel (as an address)
406 total blocks written (alias
409 resource usage (valid only for zombie)
422 scheduling priority (lower == better)
424 core residency time (in seconds; 127 = infinity)
428 .\" reverse link on run queue, or 0
432 resident set size + (text size / text use count) (alias
435 realtime priority (101 = not a realtime process)
439 user name (from ruid)
443 pending signals (alias
446 caught signals (alias
449 ignored signals (alias
452 blocked signals (alias
455 sleep time (in seconds; 127 = infinity)
459 symbolic process state (alias
462 saved gid from a setgid executable
464 saved uid from a setuid executable
466 control terminal device number
468 LWKT thread priority (0-31, 31 highest), and critical section count
470 thread ID (aka lightweight process ID)
472 accumulated CPU time, user + system (alias
475 control terminal process group ID
477 .\"text resident set size (in Kbytes)
479 control terminal session pointer
481 pending thread signals
483 text size (in Kbytes)
485 control terminal name (two letter abbreviation)
487 full name of control terminal
489 name to be used for accounting
495 virtual size in Kbytes (alias
498 wait channel (as a symbolic name)
500 exit or stop status (valid only for stopped or zombie process)
503 .Bl -tag -width /var/db/kvm_kernel.db -compact
505 default kernel memory
506 .It Pa /var/run/dev.db
508 .It Pa /var/db/kvm_kernel.db
509 system namelist database
511 default system namelist
532 cannot run faster than the system and is run as any other scheduled
533 process, the information it displays can never be exact.