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 $
43 .Op Fl aCcefhjlmrSTuvwx
57 displays a header line followed by lines containing information about your
58 processes that have controlling terminals.
59 This information is sorted by controlling terminal, then by process
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'
70 controlling terminal, cpu time (including both user and system time),
71 state, and associated command.
73 The process file system (see
75 should be mounted when
77 is executed, otherwise not all information will be available.
79 The options are as follows:
80 .Bl -tag -width indent
82 Display information about other users' processes as well as your own.
83 This can be disabled by setting the
84 .Va kern.ps_showallprocs
87 Change the ``command'' column output to just contain the executable name,
88 rather than the full command line.
90 Change the way the cpu percentage is calculated by using a ``raw''
91 cpu calculation that ignores ``resident'' time (this normally has
94 Display the environment as well.
96 Show commandline and environment information about swapped out processes.
97 This option is honored only if the uid of the user is 0.
99 Repeat the information header as often as necessary to guarantee one
100 header per page of information.
102 Print information associated with the following keywords:
103 user, pid, ppid, pgid, sess, jobc, state, tt, time and command.
105 List the set of available keywords.
107 Display information associated with the following keywords:
108 uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time
111 Extract values associated with the name list from the specified core
112 instead of the default
115 Sort by memory usage, instead of by process
118 Extract the name list from the specified system instead of the default
121 Add the information associated with the space or comma separated list
122 of keywords specified, after the process
124 in the default information
126 Keywords may be appended with an equals (``='') sign and a string.
127 This causes the printed header to use the specified string instead of
130 Display information associated with the space or comma separated list
131 of keywords specified.
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 specified process
139 Sort by current cpu usage, instead of by process
142 Change the way the process time is calculated by summing all exited
143 children to their parent process.
145 Display information about processes attached to the device associated
146 with the standard input.
148 Display information about processes attached to the specified terminal
151 Display the processes belonging to the specified
154 Display information associated with the following keywords:
155 user, pid, %cpu, %mem, vsz, rss, tt, state, start, time and command.
162 Display information associated with the following keywords:
163 pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz,
164 %cpu, %mem and command.
171 Use 132 columns to display information, instead of the default which
175 option is specified more than once,
177 will use as many columns as necessary without regard for your window size.
179 Display information about processes without controlling terminals.
182 A complete list of the available keywords are listed below.
183 Some of these keywords are further specified as follows:
184 .Bl -tag -width indent
186 The cpu utilization of the process; this is a decaying average over up to
187 a minute of previous (real) time.
188 Since the time base over which this is computed varies (since processes may
189 be very young) it is possible for the sum of all
191 fields to exceed 100%.
193 The percentage of real memory used by this process.
195 The flags associated with the process as in
198 .Bl -column P_NOCLDSTOP P_NOCLDSTOP
199 .It Dv "P_ADVLOCK" Ta No "0x00001 Process may hold a POSIX advisory lock"
200 .It Dv "P_CONTROLT" Ta No "0x00002 Has a controlling terminal"
201 .It Dv "P_INMEM" Ta No "0x00004 Loaded into memory"
202 .It Dv "P_NOCLDSTOP" Ta No "0x00008 No SIGCHLD when children stop"
203 .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit"
204 .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling"
205 .It Dv "P_SELECT" Ta No "0x00040 Selecting; wakeup/waiting danger"
206 .It Dv "P_SINTR" Ta No "0x00080 Sleep is interruptible"
207 .It Dv "P_SUGID" Ta No "0x00100 Had set id privileges since last exec"
208 .It Dv "P_SYSTEM" Ta No "0x00200 System proc: no sigs, stats or swapping"
209 .It Dv "P_TIMEOUT" Ta No "0x00400 Timing out during sleep"
210 .It Dv "P_TRACED" Ta No "0x00800 Debugged process being traced"
211 .It Dv "P_WAITED" Ta No "0x01000 Debugging process has waited for child"
212 .It Dv "P_WEXIT" Ta No "0x02000 Working on exiting"
213 .It Dv "P_EXEC" Ta No "0x04000 Process called exec"
214 .It Dv "P_OWEUPC" Ta No "0x20000 Owe process an addupc() call at next ast"
215 .It Dv "P_SWAPPING" Ta No "0x40000 Process is being swapped"
218 The soft limit on memory used, specified via a call to
221 The exact time the command started, using the ``%c'' format described in
224 The process scheduling increment (see
225 .Xr setpriority 2 ) .
227 the real memory (resident set) size of the process (in 1024 byte units).
229 The time the command started.
230 If the command started less than 24 hours ago, the start time is
231 displayed using the ``%l:ps.1p'' format described in
233 If the command started less than 7 days ago, the start time is
234 displayed using the ``%a6.15p'' format.
235 Otherwise, the start time is displayed using the ``%e%b%y'' format.
237 The state is given by a sequence of letters, for example,
239 The first letter indicates the run state of the process:
241 .Bl -tag -width indent -compact
243 Marks a process in disk (or other short term, uninterruptible) wait.
245 Marks a process that is idle (sleeping for longer than about 20 seconds).
247 Marks a process which is in
249 The hostname of the prison can be found in
250 .Ql Li /proc/<pid>/status .
252 Marks a runnable process.
254 Marks a process that is sleeping for less than about 20 seconds.
256 Marks a stopped process.
258 Marks a dead process (a ``zombie'').
261 Additional characters after these, if any, indicate additional state
264 .Bl -tag -width indent -compact
266 The process is in the foreground process group of its control terminal.
268 The process has raised
272 The process has specified a soft limit on memory requirements and is
273 currently exceeding that limit; such a process is (necessarily) not
276 the process has asked for random page replacement
277 .Pf ( Dv MADV_RANDOM ,
282 in a garbage collect).
284 The process is trying to exit.
286 The process has pages locked in core (for example, for raw
289 The process has reduced
291 scheduling priority (see
292 .Xr setpriority 2 ) .
294 The process has asked for
297 .Pf ( Dv MADV_SEQUENTIAL ,
300 for example, a large image processing program using virtual memory to
301 sequentially address voluminous data).
303 The process is a session leader.
305 The process is suspended during a
308 The process is swapped out.
310 The process is being traced or debugged.
313 An abbreviation for the pathname of the controlling terminal, if any.
314 The abbreviation consists of the three letters following
316 or, for the console, ``con''.
317 This is followed by a ``-'' if the process can no longer reach that
318 controlling terminal (i.e., it has been revoked).
320 The event (an address in the system) on which a process waits.
321 When printed numerically, the initial part of the address is
322 trimmed off and the result is printed in hex, for example, 0x80324000 prints
326 When printing using the command 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
338 The ucomm (accounting) keyword can, however, be depended on.
340 The following is a complete list of the available keywords and their
342 Several of them have aliases (keywords which are synonyms).
344 .Bl -tag -width sigignore -compact
346 percentage cpu usage (alias pcpu)
348 percentage memory usage (alias pmem)
350 accounting flag (alias acflg)
352 command and arguments
354 short-term cpu usage factor (for scheduling)
356 the process flags, in hexadecimal (alias f)
358 total blocks read (alias inblock)
368 login name of user who started the process
376 total messages received (reads from pipes/sockets)
378 total messages sent (writes on pipes/sockets)
380 nice value (alias ni)
382 total involuntary context switches
384 total signals taken (alias nsignals)
388 total voluntary context switches
390 wait channel (as an address)
392 total blocks written (alias oublock)
394 resource usage (valid only for zombie)
398 pageins (same as majflt)
412 core residency time (in seconds; 127 = infinity)
417 reverse link on run queue, or 0
421 resident set size + (text size / text use count) (alias rssize)
423 realtime priority (101 = not a realtime process)
428 user name (from ruid)
432 pending signals (alias pending)
434 caught signals (alias caught)
436 ignored signals (alias ignored)
438 blocked signals (alias blocked)
440 sleep time (in seconds; 127 = infinity)
444 symbolic process state (alias stat)
446 saved gid from a setgid executable
448 saved uid from a setuid executable
450 control terminal device number
452 accumulated cpu time, user + system (alias cputime)
454 control terminal process group
457 .\"text resident set size (in Kbytes)
459 control terminal session pointer
461 text size (in Kbytes)
463 control terminal name (two letter abbreviation)
465 full name of control terminal
469 name to be used for accounting
474 scheduling priority on return from system call (alias usrpri)
478 virtual size in Kbytes (alias vsize)
480 wait channel (as a symbolic name)
482 exit or stop status (valid only for stopped or zombie process)
485 .Bl -tag -width /var/db/kvm_kernel.db -compact
487 default kernel memory
488 .It Pa /var/run/dev.db
490 .It Pa /var/db/kvm_kernel.db
491 system namelist database
493 default system namelist
509 cannot run faster than the system and is run as any other scheduled
510 process, the information it displays can never be exact.