1 .\" $NetBSD: ps.1,v 1.103 2014/01/15 09:24:31 wiz Exp $
3 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" @(#)ps.1 8.3 (Berkeley) 4/18/94
40 .Op Fl AaCcehjlmrSsTuvwx
54 displays a header line followed by lines containing information about
56 By default, the display includes only processes that have
57 controlling terminals and are owned by your uid.
58 The default sort order of controlling terminal and
59 (among processes with the same controlling terminal) process
61 may be changed using the
67 The information displayed for each process
68 is selected based on a set of keywords (see the
74 The default output format includes, for each process, the process'
76 controlling terminal, CPU time (including both user and system time),
77 state, and associated command.
79 The options are as follows:
80 .Bl -tag -width XNXsystemXX
82 Display information about all processes.
86 Display information about other users' processes as well as your own.
87 Note that this does not display information about processes
88 without controlling terminals.
90 Change the way the CPU percentage is calculated by using a
92 CPU calculation that ignores
94 time (this normally has no effect).
96 Do not display full command with arguments, but only the
98 This may be somewhat confusing; for example, all
103 Display the environment as well.
104 The environment for other
105 users' processes can only be displayed by the super-user.
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 .Ar user , pid , ppid , pgid , sess , jobc , state , tt , time ,
115 Sort the output using the space or comma separated list of keywords.
116 Multiple sort keys may be specified, using any of the
121 The default sort order is equivalent to
124 List the set of available keywords.
126 Display information associated with the following keywords:
127 .Ar uid , pid , ppid , cpu , pri , nice , vsz , rss , wchan , state ,
132 Extract values from the specified core file instead of the running system.
134 Sort by memory usage.
135 This is equivalent to
138 Extract the name list from the specified system instead of the default,
144 Display information associated with the space or comma separated list
145 of keywords specified.
148 option does not suppress the default display;
149 it inserts additional keywords just after the
151 keyword in the default display, or after the
153 keyword (if any) in a non-default display specified before the
157 Keywords inserted by multiple
159 options will be adjacent.
163 followed by a customised header string may be appended to a keyword,
164 as described in more detail under the
168 Display information associated with the space or comma separated list
169 of keywords specified.
172 option suppresses the set of keywords that would be displayed by default,
173 or appends to the set of keywords specified by other options.
177 followed by a customised header string may be appended to a keyword.
178 This causes the printed header to use the specified string instead of
179 the default header associated with the keyword.
181 Everything after the first equals sign is part of the customised
182 header text, and this may include embedded spaces
188 To specify multiple keywords with customised headers, use multiple
194 If all the keywords to be displayed have customised headers,
195 and all the customised headers are entirely empty,
196 then the header line is not printed at all.
198 Display information associated with the specified process
201 Sort by current CPU usage.
202 This is equivalent to
205 Change the way the process time is calculated by summing all exited
206 children to their parent process.
208 Display one line for each LWP, rather than one line for each process,
209 and display information associated with the following keywords:
210 .Ar uid , pid , ppid , cpu , lid , nlwp , pri , nice , vsz , rss ,
211 .Ar wchan , lstate , tt , time ,
215 Display information about processes attached to the device associated
216 with the standard input.
218 Display information about processes attached to the specified terminal
222 for processes not attached to a
223 terminal device and a minus sign
225 for processes that have
226 been revoked from their terminal device.
228 Display processes belonging to the specified user,
229 given either as a user name or a uid.
231 Display information associated with the following keywords:
232 .Ar user , pid , %cpu , %mem , vsz , rss , tt , state , start , time ,
241 Display information associated with the following keywords:
242 .Ar pid , state , time , sl , re , pagein , vsz , rss , lim , tsiz ,
252 Extract swap information from the specified file instead of the default,
258 Use 132 columns to display information instead of the default, which
262 option is specified more than once,
264 will use as many columns as necessary without regard to your window size.
266 Also display information about processes without controlling terminals.
269 A complete list of the available keywords are listed below.
270 Some of these keywords are further specified as follows:
271 .Bl -tag -width indent
273 The CPU utilization of the process; this is a decaying average over up to
274 a minute of previous (real) time.
275 Since the time base over which this is computed varies (since processes may
276 be very young) it is possible for the sum of all
278 fields to exceed 100%.
280 The percentage of real memory used by this process.
282 The flags (in hexadecimal) associated with the process as in
285 .Bl -column P_NOCLDSTOP P_NOCLDSTOP compact
286 .It Dv "P_ADVLOCK" Ta No "0x00000001 process may hold a POSIX advisory lock"
287 .It Dv "P_CONTROLT" Ta No "0x00000002 process has a controlling terminal"
288 .It Dv "P_NOCLDSTOP" Ta No "0x00000008 no" Dv SIGCHLD No when children stop
289 .It Dv "P_PPWAIT" Ta No "0x00000010 parent is waiting for child to exec/exit"
290 .It Dv "P_PROFIL" Ta No "0x00000020 process has started profiling"
291 .It Dv "P_SELECT" Ta No "0x00000040 selecting; wakeup/waiting danger"
292 .It Dv "P_SINTR" Ta No "0x00000080 sleep is interruptible"
293 .It Dv "P_SUGID" Ta No "0x00000100 process had set id privileges since last exec"
294 .It Dv "P_SYSTEM" Ta No "0x00000200 system process: no sigs or stats"
295 .It Dv "P_TIMEOUT" Ta No "0x00000400 timing out during sleep"
296 .It Dv "P_TRACED" Ta No "0x00000800 process is being traced"
297 .It Dv "P_WAITED" Ta No "0x00001000 debugging process has waited for child"
298 .It Dv "P_WEXIT" Ta No "0x00002000 working on exiting"
299 .It Dv "P_EXEC" Ta No "0x00004000 process called" Xr execve 2
300 .It Dv "P_OWEUPC" Ta No "0x00008000 owe process an addupc() call at next ast"
301 .\" the routine addupc is not documented in the man pages
302 .It Dv "P_FSTRACE" Ta No "0x00010000 tracing via file system"
303 .It Dv "P_NOCLDWAIT" Ta No "0x00020000 no zombies when children die"
304 .It Dv "P_32" Ta No "0x00040000 32-bit process (used on 64-bit kernels)"
305 .It Dv "P_BIGLOCK" Ta No "0x00080000 process needs kernel ``big lock'' to run"
306 .It Dv "P_INEXEC" Ta No "0x00100000 process is exec'ing and cannot be traced"
309 The soft limit on memory used, specified via a call to
312 The exact time the command started, using the
317 The process scheduling increment (see
318 .Xr setpriority 2 ) .
320 the real memory (resident set) size of the process (in 1024 byte units).
322 The time the command started.
323 If the command started less than 24 hours ago, the start time is
328 If the command started less than 7 days ago, the start time is
332 Otherwise, the start time is displayed using the
336 The state is given by a sequence of letters, for example,
338 The first letter indicates the run state of the process:
340 .Bl -tag -width indent -compact
342 Marks a process in device or other short term, uninterruptible wait.
344 Marks a process that is idle (sleeping interruptibly for longer than about
346 (default 20) seconds).
348 Marks a process running on a processor.
350 Marks a runnable process, or one that is in the process of creation.
352 Marks a process that is sleeping interruptibly for less than about
354 (default 20) seconds.
356 Marks a stopped process.
358 Marks a suspended process.
360 Marks a dead process that has exited, but not been waited for (a
364 Additional characters after these, if any, indicate additional state
367 .Bl -tag -width indent -compact
369 The process is in the foreground process group of its control terminal.
371 The LWP is detached (can't be waited for).
373 The process has raised
377 The process is using scheduler activations (deprecated).
379 The process is in the process of exiting.
381 The process is a kernel thread or system process.
383 The process has multiple LWPs.
385 The process is niced (has reduced
387 scheduling priority) (see
388 .Xr setpriority 2 ) .
390 The process is a session leader.
392 The process is suspended during a
395 The process is being traced or debugged.
398 An abbreviation for the pathname of the controlling terminal, if any.
399 The abbreviation consists of the two letters following
403 This is followed by a
405 if the process can no longer reach that
406 controlling terminal (i.e., it has been revoked).
408 The event (an address in the system) on which a process waits.
409 When printed numerically, the initial part of the address is
410 trimmed off and the result is printed in hex, for example, 0x80324000 prints
414 When printing using the
416 keyword, a process that has exited and has a parent that has not yet
417 waited for the process (in other words, a zombie) is listed as
419 and a process which is blocked while trying to exit is listed as
423 will try to locate the processes' argument vector from the user
424 area in order to print the command name and arguments.
425 This method is not reliable because a process is allowed to destroy this
429 (accounting) keyword will always contain the real command name as
430 contained in the process structure's
434 If the command vector cannot be located (usually because it has not
435 been set, as is the case of system processes and/or kernel threads)
436 the command name is printed within square brackets.
438 To indicate that the argument vector has been tampered with,
440 will append the real command name to the output within parentheses
441 if the basename of the first argument in the argument vector
442 does not match the contents of the real command name.
446 checks for the following two situations and does not append the
447 real command name parenthesized:
448 .Bl -tag -width indent
450 The login process traditionally adds a
452 in front of the shell name to indicate a login shell.
454 will not append parenthesized the command name if it matches with
455 the name in the first argument of the argument vector, skipping
458 .It daemonname: current-activity
459 Daemon processes frequently report their current activity by setting
460 their name to be like
461 .Dq daemonname: current-activity .
463 will not append parenthesized the command name, if the string preceding the
465 in the first argument of the argument vector matches the command name.
468 The following is a complete list of the available keywords and their
470 Several of them have aliases (keywords which are synonyms).
472 .Bl -tag -width groupnames -compact
474 percentage CPU usage (alias
477 percentage memory usage (alias
480 accounting flag (alias
483 command (the argv[0] value)
485 command and arguments (alias
488 short-term CPU usage factor (for scheduling)
490 CPU number the current process or lwp is running on.
492 accumulated CPU time of all children that have exited
496 group name (from egid)
500 elapsed time since the process was started, in the form
505 user name (from euid)
507 the process flags, in hexadecimal (alias
512 group name (from gid)
514 group names (from group access list)
518 total blocks read (alias
527 kernel virtual address of the
529 belonging to the LWP.
535 descriptive name of the LWP
537 login name of user who started the process (alias
550 total messages received (reads from pipes/sockets)
552 total messages sent (writes on pipes/sockets)
557 total involuntary context switches
559 number of LWPs in the process
561 total signals taken (alias
564 total voluntary context switches
566 wait channel (as an address)
568 total blocks written (alias
571 resource usage pointer (valid only for zombie)
573 kernel virtual address of the
575 belonging to the process.
577 pageins (same as majflt)
589 core residency time (in seconds; 127 = infinity)
594 reverse link on run queue, or 0
596 number of LWPs on a processor or run queue
600 resident set size + (text size / text use count) (alias
606 user name (from ruid)
613 pending signals (alias
616 caught signals (alias
619 ignored signals (alias
622 blocked signals (alias
625 sleep time (in seconds; 127 = infinity)
629 symbolic process state (alias
632 accumulated system CPU time
634 saved gid from a setgid executable
636 group name (from svgid)
638 saved uid from a setuid executable
640 user name (from svuid)
642 control terminal device number
644 accumulated CPU time, user + system (alias
647 control terminal process group
650 control terminal session pointer
652 text size (in Kbytes)
654 control terminal name (two letter abbreviation)
656 full name of control terminal
658 kernel virtual address of the
660 belonging to the LWP.
662 name to be used for accounting
667 scheduling priority on return from system call (alias
672 accumulated user CPU time
674 virtual size in Kbytes (alias
677 wait channel (as a symbolic name)
679 exit or stop status (valid only for stopped or zombie process)
682 .Bl -tag -width /var/run/kvm.db -compact
684 special files and device names
687 .It Pa /var/run/dev.cdb
689 .It Pa /var/db/kvm.db
690 system name list database
692 default system name list
707 cannot run faster than the system and is run as any other scheduled
708 process, the information it displays can never be exact.