1 .\" $NetBSD: ps.1,v 1.90 2009/10/21 21:11:57 rmind 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 indent
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,
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 Displays processes belonging to the user whose username or uid has
233 Display information associated with the following keywords:
234 .Ar user , pid , %cpu , %mem , vsz , rss , tt , state , start , time ,
243 Display information associated with the following keywords:
244 .Ar pid , state , time , sl , re , pagein , vsz , rss , lim , tsiz ,
254 Extract swap information from the specified file instead of the
261 Use 132 columns to display information, instead of the default which
265 option is specified more than once,
267 will use as many columns as necessary without regard for your window size.
269 Also display information about processes without controlling terminals.
272 A complete list of the available keywords are listed below.
273 Some of these keywords are further specified as follows:
274 .Bl -tag -width indent
276 The CPU utilization of the process; this is a decaying average over up to
277 a minute of previous (real) time.
278 Since the time base over which this is computed varies (since processes may
279 be very young) it is possible for the sum of all
281 fields to exceed 100%.
283 The percentage of real memory used by this process.
285 The flags (in hexadecimal) associated with the process as in
288 .Bl -column P_NOCLDSTOP P_NOCLDSTOP compact
289 .It Dv "P_ADVLOCK" Ta No "0x00000001 process may hold a POSIX advisory lock"
290 .It Dv "P_CONTROLT" Ta No "0x00000002 process has a controlling terminal"
291 .It Dv "P_NOCLDSTOP" Ta No "0x00000008 no
294 .It Dv "P_PPWAIT" Ta No "0x00000010 parent is waiting for child to exec/exit"
295 .It Dv "P_PROFIL" Ta No "0x00000020 process has started profiling"
296 .It Dv "P_SELECT" Ta No "0x00000040 selecting; wakeup/waiting danger"
297 .It Dv "P_SINTR" Ta No "0x00000080 sleep is interruptible"
298 .It Dv "P_SUGID" Ta No "0x00000100 process had set id privileges since last exec"
299 .It Dv "P_SYSTEM" Ta No "0x00000200 system process: no sigs or stats"
300 .It Dv "P_TIMEOUT" Ta No "0x00000400 timing out during sleep"
301 .It Dv "P_TRACED" Ta No "0x00000800 process is being traced"
302 .It Dv "P_WAITED" Ta No "0x00001000 debugging process has waited for child"
303 .It Dv "P_WEXIT" Ta No "0x00002000 working on exiting"
304 .It Dv "P_EXEC" Ta No "0x00004000 process called"
306 .It Dv "P_OWEUPC" Ta No "0x00008000 owe process an addupc() call at next ast"
307 .\" the routine addupc is not documented in the man pages
308 .It Dv "P_FSTRACE" Ta No "0x00010000 tracing via file system"
309 .It Dv "P_NOCLDWAIT" Ta No "0x00020000 no zombies when children die"
310 .It Dv "P_32" Ta No "0x00040000 32-bit process (used on 64-bit kernels)"
311 .It Dv "P_BIGLOCK" Ta No "0x00080000 process needs kernel ``big lock'' to run"
312 .It Dv "P_INEXEC" Ta No "0x00100000 process is exec'ing and cannot be traced"
315 The soft limit on memory used, specified via a call to
318 The exact time the command started, using the
323 The process scheduling increment (see
324 .Xr setpriority 2 ) .
326 the real memory (resident set) size of the process (in 1024 byte units).
328 The time the command started.
329 If the command started less than 24 hours ago, the start time is
334 If the command started less than 7 days ago, the start time is
338 Otherwise, the start time is displayed using the
342 The state is given by a sequence of letters, for example,
344 The first letter indicates the run state of the process:
346 .Bl -tag -width indent -compact
348 Marks a process in disk (or other short term, uninterruptible) wait.
350 Marks a process that is idle (sleeping for longer than about 20 seconds).
352 Marks a process running on a processor.
354 Marks a runnable process, or one that is in the process of creation.
356 Marks a process that is sleeping for less than about 20 seconds.
358 Marks a stopped process.
360 Marks a suspended process.
362 Marks a dead process (a
366 Additional characters after these, if any, indicate additional state
369 .Bl -tag -width indent -compact
371 The process is in the foreground process group of its control terminal.
373 The LWP is detached (can't be waited for).
375 The process has raised
379 The process is using scheduler activations.
381 The process is trying to exit.
383 The process is a kernel thread or system process.
385 The process has multiple LWPs.
387 The process has reduced
389 scheduling priority (see
390 .Xr setpriority 2 ) .
392 The process is a session leader.
394 The process is suspended during a
397 The process is being traced or debugged.
400 An abbreviation for the pathname of the controlling terminal, if any.
401 The abbreviation consists of the two letters following
405 This is followed by a
407 if the process can no longer reach that
408 controlling terminal (i.e., it has been revoked).
410 The event (an address in the system) on which a process waits.
411 When printed numerically, the initial part of the address is
412 trimmed off and the result is printed in hex, for example, 0x80324000 prints
416 When printing using the
418 keyword, a process that has exited and has a parent that has not yet
419 waited for the process (in other words, a zombie) is listed as
421 and a process which is blocked while trying to exit is listed as
425 will try to locate the processes' argument vector from the user
426 area in order to print the command name and arguments.
427 This method is not reliable because a process is allowed to destroy this
431 (accounting) keyword will always contain the real command name as
432 contained in the process structure's
436 If the command vector cannot be located (usually because it has not
437 been set, as is the case of system processes and/or kernel threads)
438 the command name is printed within square brackets.
440 To indicate that the argument vector has been tampered with,
442 will append the real command name to the output within parentheses
443 if the basename of the first argument in the argument vector
444 does not match the contents of the real command name.
448 checks for the following two situations and does not append the
449 real command name parenthesized:
450 .Bl -tag -width indent
452 The login process traditionally adds a
454 in front of the shell name to indicate a login shell.
456 will not append parenthesized the command name if it matches with
457 the name in the first argument of the argument vector, skipping
460 .It daemonname: current-activity
461 Daemon processes frequently report their current activity by setting
462 their name to be like
463 .Dq daemonname: current-activity .
465 will not append parenthesized the command name, if the string preceding the
467 in the first argument of the argument vector matches the command name.
470 The following is a complete list of the available keywords and their
472 Several of them have aliases (keywords which are synonyms).
474 .Bl -tag -width groupnames -compact
476 percentage CPU usage (alias
479 percentage memory usage (alias
482 accounting flag (alias
485 command (the argv[0] value)
487 command and arguments (alias
490 short-term CPU usage factor (for scheduling)
492 CPU number the current process or lwp is running on.
494 accumulated CPU time of all children that have exited
498 group name (from egid)
502 elapsed time since the process was started, in the form
507 user name (from euid)
509 the process flags, in hexadecimal (alias
514 group name (from gid)
516 group names (from group access list)
520 total blocks read (alias
529 kernel virtual address of the
531 belonging to the LWP.
537 descriptive name of the LWP
539 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.db
689 .It Pa /var/db/kvm.db
690 system namelist database
692 default system namelist
707 cannot run faster than the system and is run as any other scheduled
708 process, the information it displays can never be exact.