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.12 2006/05/28 23:12:09 dillon Exp $
44 .Op Fl aCcefhjlmrSTuvwx
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 kern.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 Repeat the information header as often as necessary to guarantee one
99 header per page of information.
101 Print information associated with the following keywords:
102 .Cm user , pid , ppid , pgid , sess , jobc , state , tt , time ,
106 List the set of available keywords.
108 Display information associated with the following keywords:
109 .Cm uid , pid , ppid , cpu , pri , nice , vsz , rss , wchan , state ,
114 Extract values associated with the name list from the specified core
115 instead of the default
118 Sort by memory usage, instead of by process ID.
120 Extract the name list from the specified system instead of the default
123 Add the information associated with the space or comma separated list
124 of keywords specified, after the process ID,
125 in the default information
127 Keywords may be appended with an equals (``='') sign and a string.
128 This causes the printed header to use the specified string instead of
131 Display information associated with the space or comma separated list
132 of keywords specified.
133 Keywords may be appended with an equals (``='') sign and a string.
134 This causes the printed header to use the specified string instead of
137 Display information associated with the specified process ID.
139 Sort by current CPU usage, instead of by process ID.
141 Change the way the process time is calculated by summing all exited
142 children to their parent process.
144 Display information about processes attached to the device associated
145 with the standard input.
147 Display information about processes attached to the specified terminal
150 Display the processes belonging to the specified
153 Display information associated with the following keywords:
154 .Cm user , pid, %cpu , %mem , vsz , rss , tt , state , start , time ,
163 Display information associated with the following keywords:
164 .Cm pid , state , time , sl , re , pagein , vsz , rss , lim , tsiz ,
174 Use 132 columns to display information, instead of the default which
178 option is specified more than once,
180 will use as many columns as necessary without regard for your window size.
182 Display information about processes without controlling terminals.
185 A complete list of the available keywords are listed below.
186 Some of these keywords are further specified as follows:
187 .Bl -tag -width ".Cm lstart"
189 The CPU utilization of the process; this is a decaying average over up to
190 a minute of previous (real) time.
191 Since the time base over which this is computed varies (since processes may
192 be very young) it is possible for the sum of all
194 fields to exceed 100%.
196 The percentage of real memory used by this process.
198 The flags associated with the process as in
201 .Bl -column P_BREAKTSLEEP 0x10000000
202 .It Dv "P_ADVLOCK" Ta No "0x00001 Process may hold a POSIX advisory lock"
203 .It Dv "P_CONTROLT" Ta No "0x00002 Has a controlling terminal"
204 .It Dv "P_SWAPPEDOUT" Ta No "0x00004 Swapped out of memory"
205 .It Dv "P_BREAKTSLEEP" Ta No "0x00008 Event pending, break tsleep on sigcont"
206 .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit"
207 .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling"
208 .It Dv "P_SELECT" Ta No "0x00040 Selecting; wakeup/waiting danger"
209 .It Dv "P_SINTR" Ta No "0x00080 Sleep is interruptible"
210 .It Dv "P_SUGID" Ta No "0x00100 Had set id privileges since last exec"
211 .It Dv "P_SYSTEM" Ta No "0x00200 System proc: no sigs, stats or swapping"
212 .It Dv "P_STOPPED" Ta No "0x00400 SIGSTOP status"
213 .It Dv "P_TRACED" Ta No "0x00800 Debugged process being traced"
214 .It Dv "P_WAITED" Ta No "0x01000 SIGSTOP status was returned by wait3/4"
215 .It Dv "P_WEXIT" Ta No "0x02000 Working on exiting"
216 .It Dv "P_EXEC" Ta No "0x04000 Process called exec"
217 .It Dv "P_UPCALLPEND" Ta No "0x20000 An upcall is pending"
218 .It Dv "P_SWAPWAIT" Ta No "0x40000 Waiting for a swapin"
219 .It Dv "P_ZOMBIE" Ta No "0x80000 Now in a zombied state"
220 .It Dv "P_ONRUNQ" Ta No "0x100000 On a user scheduling run queue"
221 .It Dv "P_KTHREADP" Ta No "0x200000 Process is really a kernel thread"
222 .It Dv "P_IDLESWAP" Ta No "0x400000 Swapout was due to idleswap, not load"
223 .It Dv "P_DEADLKTREAT" Ta No "0x800000 Lock aquisition - deadlock treatment"
224 .It Dv "P_JAILED" Ta No "0x1000000 Process is in jail"
225 .It Dv "P_OLDMASK" Ta No "0x2000000 Need to restore mask before pause"
226 .It Dv "P_ALTSTACK" Ta No "0x4000000 have alternate signal stack"
227 .It Dv "P_INEXEC" Ta No "0x8000000 Process is in execve()"
228 .It Dv "P_PASSIVE_ACQ" Ta No "0x10000000 Passive acquire cpu (see kern_switch)"
229 .It Dv "P_UPCALLWAIT" Ta No "0x20000000 Wait for upcall or signal"
232 The soft limit on memory used, specified via a call to
235 The exact time the command started, using the ``%c'' format described in
238 The process scheduling increment (see
239 .Xr setpriority 2 ) .
241 the real memory (resident set) size of the process (in 1024 byte units).
243 The time the command started.
244 If the command started less than 24 hours ago, the start time is
245 displayed using the ``%l:ps.1p'' format described in
247 If the command started less than 7 days ago, the start time is
248 displayed using the ``%a6.15p'' format.
249 Otherwise, the start time is displayed using the ``%e%b%y'' format.
251 The state is given by a sequence of letters, for example,
253 The first letter indicates the run state of the process:
255 .Bl -tag -width indent -compact
257 Marks a process in disk (or other short term, uninterruptible) wait.
259 Marks a process that is idle (sleeping for longer than about 20 seconds).
261 Marks a process which is in
263 The hostname of the prison can be found in
264 .Pa /proc/ Ns Ao Ar pid Ac Ns Pa /status .
266 Marks a runnable process.
268 Marks a process that is sleeping for less than about 20 seconds.
270 Marks a stopped process.
272 Marks a dead process (a
276 Additional characters after these, if any, indicate additional state
279 .Bl -tag -width indent -compact
281 The process is in the foreground process group of its control terminal.
283 The process has raised CPU scheduling priority.
285 The process has specified a soft limit on memory requirements and is
286 currently exceeding that limit; such a process is (necessarily) not
289 the process has asked for random page replacement
290 .Pf ( Dv MADV_RANDOM ,
295 in a garbage collect).
297 The process is trying to exit.
299 The process has pages locked in core (for example, for raw
302 On SMP systems indicates a process or thread which is
304 holding the MP lock (the Big Giant Lock).
306 The process has reduced CPU scheduling priority (see
307 .Xr setpriority 2 ) .
309 The process has asked for FIFO page replacement
310 .Pf ( Dv MADV_SEQUENTIAL ,
313 for example, a large image processing program using virtual memory to
314 sequentially address voluminous data).
316 The process is a session leader.
318 The process is suspended during a
321 The process is swapped out.
323 The process is being traced or debugged.
326 An abbreviation for the pathname of the controlling terminal, if any.
327 The abbreviation consists of the three letters following
329 or, for the console, ``con''.
330 This is followed by a ``-'' if the process can no longer reach that
331 controlling terminal (i.e., it has been revoked).
333 The event (an address in the system) on which a process waits.
334 When printed numerically, the initial part of the address is
335 trimmed off and the result is printed in hex, for example, 0x80324000 prints
339 When printing using the
341 keyword, a process that has exited and
342 has a parent that has not yet waited for the process (in other words, a zombie)
343 is listed as ``<defunct>'', and a process which is blocked while trying
344 to exit is listed as ``<exiting>''.
348 makes an educated guess as to the file name and arguments given when the
349 process was created by examining memory or the swap area.
350 The method is inherently somewhat unreliable and in any event a process
351 is entitled to destroy this information, so the names cannot be depended
355 (accounting) keyword can, however, be depended on.
357 The following is a complete list of the available keywords and their
359 Several of them have aliases (keywords which are synonyms).
361 .Bl -tag -width ".Cm sigignore" -compact
363 percentage CPU usage (alias
366 percentage memory usage (alias
369 accounting flag (alias
372 batchness of the process (higher numbers mean less interactivity)
374 command and arguments
376 short-term CPU usage factor (for scheduling)
378 the process flags, in hexadecimal (alias
381 total blocks read (alias
392 CPU ID the process was last scheduled on
396 login name of user who started the process (alias
405 total messages received (reads from pipes/sockets)
407 total messages sent (writes on pipes/sockets)
412 total involuntary context switches
414 total signals taken (alias
419 total voluntary context switches
421 wait channel (as an address)
423 total blocks written (alias
426 resource usage (valid only for zombie)
439 scheduling priority (lower == better)
441 core residency time (in seconds; 127 = infinity)
445 reverse link on run queue, or 0
449 resident set size + (text size / text use count) (alias
452 realtime priority (101 = not a realtime process)
456 user name (from ruid)
460 pending signals (alias
463 caught signals (alias
466 ignored signals (alias
469 blocked signals (alias
472 sleep time (in seconds; 127 = infinity)
476 symbolic process state (alias
479 saved gid from a setgid executable
481 saved uid from a setuid executable
483 control terminal device number
485 LWKT thread priority (0-31, 31 highest), and critical section count
487 accumulated CPU time, user + system (alias
490 control terminal process group ID
492 .\"text resident set size (in Kbytes)
494 control terminal session pointer
496 text size (in Kbytes)
498 control terminal name (two letter abbreviation)
500 full name of control terminal
502 name to be used for accounting
508 virtual size in Kbytes (alias
511 wait channel (as a symbolic name)
513 exit or stop status (valid only for stopped or zombie process)
516 .Bl -tag -width /var/db/kvm_kernel.db -compact
518 default kernel memory
519 .It Pa /var/run/dev.db
521 .It Pa /var/db/kvm_kernel.db
522 system namelist database
524 default system namelist
545 cannot run faster than the system and is run as any other scheduled
546 process, the information it displays can never be exact.