xref: /openbsd-src/bin/ps/ps.1 (revision 85ce0bb8dee469f412bbfb468c4393478423bbdd)
1*85ce0bb8Sclaudio.\"	$OpenBSD: ps.1,v 1.139 2024/10/15 13:49:49 claudio Exp $
24ed7fa4bSderaadt.\"	$NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $
3df930be7Sderaadt.\"
4df930be7Sderaadt.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
5df930be7Sderaadt.\"	The Regents of the University of California.  All rights reserved.
6df930be7Sderaadt.\"
7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without
8df930be7Sderaadt.\" modification, are permitted provided that the following conditions
9df930be7Sderaadt.\" are met:
10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright
11df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer.
12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
13df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
14df930be7Sderaadt.\"    documentation and/or other materials provided with the distribution.
1529295d1cSmillert.\" 3. Neither the name of the University nor the names of its contributors
16df930be7Sderaadt.\"    may be used to endorse or promote products derived from this software
17df930be7Sderaadt.\"    without specific prior written permission.
18df930be7Sderaadt.\"
19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22df930be7Sderaadt.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29df930be7Sderaadt.\" SUCH DAMAGE.
30df930be7Sderaadt.\"
31df930be7Sderaadt.\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
32df930be7Sderaadt.\"
33*85ce0bb8Sclaudio.Dd $Mdocdate: October 15 2024 $
34df930be7Sderaadt.Dt PS 1
35fc8533a3Saaron.Os
36df930be7Sderaadt.Sh NAME
37f11c8a18Saaron.Nm ps
3871ff9a1aSjmc.Nd display process status
39df930be7Sderaadt.Sh SYNOPSIS
407349792aSaaron.Nm ps
415d0d4049Sderaadt.Sm off
4224ca0f25Sjob.Op Oo Fl Oc Cm AacefHhjkLlmrSTuvwx
435d0d4049Sderaadt.Sm on
44df930be7Sderaadt.Op Fl M Ar core
45df930be7Sderaadt.Op Fl N Ar system
46df930be7Sderaadt.Op Fl O Ar fmt
47df930be7Sderaadt.Op Fl o Ar fmt
48df930be7Sderaadt.Op Fl p Ar pid
49df930be7Sderaadt.Op Fl t Ar tty
5052e706caSkn.Op Fl U Ar user
51df930be7Sderaadt.Op Fl W Ar swap
52df930be7Sderaadt.Sh DESCRIPTION
5318611b21SaaronThe
54f11c8a18Saaron.Nm
5518611b21Saaronutility displays information about active processes.
5618611b21SaaronWhen given no options,
5718611b21Saaron.Nm
58cec60693Sjmcprints information about processes of the current user that have a
59cec60693Sjmccontrolling terminal.
60df930be7Sderaadt.Pp
61f018c874SderaadtThe information displayed is selected based on a set of keywords (and for
62f81d96dfSaaroneven more control, see the
63f018c874Sderaadt.Fl L ,
64f018c874Sderaadt.Fl O ,
65df930be7Sderaadtand
66df930be7Sderaadt.Fl o
67df930be7Sderaadtoptions).
6818611b21SaaronThe default output format includes, for each process, the process's ID,
69f46f36c6Sjmccontrolling terminal, state, CPU time (including both user and system time),
70f46f36c6Sjmcand associated command.
71df930be7Sderaadt.Pp
72df930be7SderaadtThe options are as follows:
73f1ba3473Saaron.Bl -tag -width Ds
749ea50c04Sokan.It Fl A
759b00ff81SjmcDisplay information about processes for all users,
769b00ff81Sjmcincluding those without controlling terminals.
77df930be7Sderaadt.It Fl a
7861a21dd4SjmcDisplay information about processes for all users with controlling terminals.
79c22e921bSjmc.It Fl c
80c22e921bSjmcDo not display full command with arguments, but only the
81c22e921bSjmcexecutable name.
82c22e921bSjmcThis may be somewhat confusing; for example, all
83c22e921bSjmc.Xr sh 1
84c22e921bSjmcscripts will show as
85c22e921bSjmc.Dq sh .
86df930be7Sderaadt.It Fl e
87df930be7SderaadtDisplay the environment as well.
8824ca0f25Sjob.It Fl f
899b00ff81SjmcArrange processes into a tree.
909b00ff81SjmcEach command is ordered and prefixed with indentation text
919b00ff81Sjmcshowing sibling and parent/child relationships.
9224ca0f25SjobIf either of the
9324ca0f25Sjob.Fl m
9424ca0f25Sjoband
9524ca0f25Sjob.Fl r
9624ca0f25Sjoboptions are also used, they control how sibling processes are sorted relative
9724ca0f25Sjobto each other.
98fc7b2cf1Sguenther.It Fl H
99fc7b2cf1SguentherAlso display information about kernel visible threads.
100df930be7Sderaadt.It Fl h
101df930be7SderaadtRepeat the information header as often as necessary to guarantee one
102df930be7Sderaadtheader per page of information.
103df930be7Sderaadt.It Fl j
104df930be7SderaadtPrint information associated with the following keywords:
1051fd45b44Saaronuser, pid, ppid, pgid, sess, jobc, state, tt, time, and command.
1063f2d366dSniklas.It Fl k
1073f2d366dSniklasAlso display information about kernel threads.
108df930be7Sderaadt.It Fl L
109df930be7SderaadtList the set of available keywords.
110158ffbf4SjmcThis option should not be specified with other options.
111df930be7Sderaadt.It Fl l
112df930be7SderaadtDisplay information associated with the following keywords:
113158ffbf4Sjmcuid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time,
114df930be7Sderaadtand command.
115f018c874Sderaadt.It Fl M Ar core
116df930be7SderaadtExtract values associated with the name list from the specified core
117db0d9e21Smiodinstead of the running kernel.
118df930be7Sderaadt.It Fl m
11992a6e69dSjmcSort by memory usage, instead of by start time ID.
120f018c874Sderaadt.It Fl N Ar system
121db0d9e21SmiodExtract the name list from the specified system instead of the running kernel.
122f018c874Sderaadt.It Fl O Ar fmt
123df930be7SderaadtAdd the information associated with the space or comma separated list
12492a6e69dSjmcof keywords specified, after the process ID,
125df930be7Sderaadtin the default information
126df930be7Sderaadtdisplay.
127b3119326SaaronKeywords may be appended with an equals sign
128b3119326Saaron.Pq Sq =
129b3119326Saaronand a string.
130df930be7SderaadtThis causes the printed header to use the specified string instead of
131df930be7Sderaadtthe standard header.
132f018c874Sderaadt.It Fl o Ar fmt
133df930be7SderaadtDisplay information associated with the space or comma separated list
134df930be7Sderaadtof keywords specified.
135b3119326SaaronKeywords may be appended with an equals sign
136b3119326Saaron.Pq Sq =
137b3119326Saaronand a string.
138df930be7SderaadtThis causes the printed header to use the specified string instead of
139df930be7Sderaadtthe standard header.
140f018c874Sderaadt.It Fl p Ar pid
14192a6e69dSjmcDisplay information associated with the specified process ID.
142df930be7Sderaadt.It Fl r
14392a6e69dSjmcSort by current CPU usage, instead of by start time ID.
144df930be7Sderaadt.It Fl S
145df930be7SderaadtChange the way the process time is calculated by summing all exited
146df930be7Sderaadtchildren to their parent process.
147df930be7Sderaadt.It Fl T
148df930be7SderaadtDisplay information about processes attached to the device associated
149df930be7Sderaadtwith the standard input.
150f018c874Sderaadt.It Fl t Ar tty
151df930be7SderaadtDisplay information about processes attached to the specified terminal
152df930be7Sderaadtdevice.
15352e706caSkn.It Fl U Ar user
15452e706caSknOnly display processes belonging to username or UID
15552e706caSkn.Ar user .
156df930be7Sderaadt.It Fl u
157df930be7SderaadtDisplay information associated with the following keywords:
1581fd45b44Saaronuser, pid, %cpu, %mem, vsz, rss, tt, state, start, time, and command.
159df930be7SderaadtThe
160df930be7Sderaadt.Fl u
161df930be7Sderaadtoption implies the
162df930be7Sderaadt.Fl r
163df930be7Sderaadtoption.
164df930be7Sderaadt.It Fl v
165df930be7SderaadtDisplay information associated with the following keywords:
166df930be7Sderaadtpid, state, time, sl, re, pagein, vsz, rss, lim, tsiz,
167158ffbf4Sjmc%cpu, %mem, and command.
168df930be7SderaadtThe
169df930be7Sderaadt.Fl v
170df930be7Sderaadtoption implies the
171df930be7Sderaadt.Fl m
172df930be7Sderaadtoption.
173f018c874Sderaadt.It Fl W Ar swap
174ecc29f82SmiodWhen not using the running kernel,
175ecc29f82Smiodextract swap information from the specified file.
176df930be7Sderaadt.It Fl w
177f81d96dfSaaronUse 132 columns to display information, instead of the default, which
178158ffbf4Sjmcis the window size.
179df930be7SderaadtIf the
180df930be7Sderaadt.Fl w
181df930be7Sderaadtoption is specified more than once,
182f11c8a18Saaron.Nm
183158ffbf4Sjmcwill use as many columns as necessary without regard for window size.
184df930be7Sderaadt.It Fl x
185df930be7SderaadtDisplay information about processes without controlling terminals.
186df930be7Sderaadt.El
18792a6e69dSjmc.Sh KEYWORDS
18892a6e69dSjmcThe following is a complete list of the available keywords
18992a6e69dSjmcand their meanings.
19092a6e69dSjmcSeveral of them have aliases,
19192a6e69dSjmcwhich are also noted.
19292a6e69dSjmc.Bl -tag -width "sigignoreXX" -offset 3n
19392a6e69dSjmc.It Cm %cpu
19492a6e69dSjmcAlias:
19592a6e69dSjmc.Cm pcpu .
196b3119326SaaronThe CPU utilization of the process; this is a decaying average over up to
197df930be7Sderaadta minute of previous (real) time.
198df930be7SderaadtSince the time base over which this is computed varies (since processes may
19941ce3b17Snaddybe very young), it is possible for the sum of all
20092a6e69dSjmc.Cm %cpu
201df930be7Sderaadtfields to exceed 100%.
20292a6e69dSjmc.It Cm %mem
20392a6e69dSjmcAlias:
20492a6e69dSjmc.Cm pmem .
205df930be7SderaadtThe percentage of real memory used by this process.
20692a6e69dSjmc.It Cm acflag
20792a6e69dSjmcAlias:
20892a6e69dSjmc.Cm acflg .
20992a6e69dSjmcAccounting flag.
21092a6e69dSjmc.It Cm command
21192a6e69dSjmcAlias:
21292a6e69dSjmc.Cm args .
21392a6e69dSjmcCommand and arguments.
21492a6e69dSjmc.It Cm cpu
21592a6e69dSjmcShort-term CPU usage factor (for scheduling).
21692a6e69dSjmc.It Cm cpuid
21792a6e69dSjmcCPU ID (zero on single processor systems).
218def13f16Snicm.It Cm cwd
219def13f16SnicmCurrent working directory.
22092a6e69dSjmc.It Cm dsiz
22192a6e69dSjmcData size, in Kilobytes.
222588f7f8cStedu.It Cm etime
223588f7f8cSteduElapsed time since the process was started.
22492a6e69dSjmc.It Cm flags
22592a6e69dSjmcAlias:
22692a6e69dSjmc.Cm f .
227447f61ceSguentherThe thread flags (in hexadecimal), as defined in the include file
228369bef3aSschwarze.In sys/proc.h :
22992a6e69dSjmc.Bd -literal
230447f61ceSguentherP_INKTR           0x1 writing ktrace(2) record
231a554f8d9SguentherP_PROFPEND        0x2 this thread needs SIGPROF
232a554f8d9SguentherP_ALRMPEND        0x4 this thread needs SIGVTALRM
2332725daddSguentherP_SIGSUSPEND      0x8 need to restore before-suspend mask
2344c45356dSguentherP_CANTSLEEP      0x10 this thread is not permitted to sleep
235bc785136SguentherP_SINTR          0x80 sleep is interruptible
236bc785136SguentherP_SYSTEM        0x200 system process: no sigs, stats, or
23792a6e69dSjmc                      swapping
238bc785136SguentherP_TIMEOUT       0x400 timing out during sleep
239bc785136SguentherP_WEXIT        0x2000 working on exiting
240447f61ceSguentherP_OWEUPC       0x8000 profiling sample needs recording
24168b8fc1fSguentherP_SUSPSINGLE  0x80000 need to suspend for single threading
242447f61ceSguentherP_THREAD    0x4000000 not the original thread
243447f61ceSguentherP_SUSPSIG   0x8000000 stopped because of a signal
244bc785136SguentherP_CPUPEG   0x40000000 do not move to another cpu
24592a6e69dSjmc.Ed
24692a6e69dSjmc.It Cm gid
24792a6e69dSjmcEffective group.
24892a6e69dSjmc.It Cm group
24992a6e69dSjmcText name of effective group ID.
25092a6e69dSjmc.It Cm inblk
25192a6e69dSjmcAlias:
25292a6e69dSjmc.Cm inblock .
25392a6e69dSjmcTotal blocks read.
25492a6e69dSjmc.It Cm jobc
25592a6e69dSjmcJob control count.
25692a6e69dSjmc.It Cm ktrace
25792a6e69dSjmcTracing flags.
25892a6e69dSjmc.It Cm ktracep
25992a6e69dSjmcTracing vnode.
26092a6e69dSjmc.It Cm lim
261df930be7SderaadtThe soft limit on memory used, specified via a call to
262df930be7Sderaadt.Xr setrlimit 2 .
26392a6e69dSjmc.It Cm logname
26492a6e69dSjmcAlias:
26592a6e69dSjmc.Cm login .
26692a6e69dSjmcLogin name of user who started the process.
26792a6e69dSjmc.It Cm lstart
268b3119326SaaronThe exact time the command started, using the
269577b6846Sd.Dq %c
270b3119326Saaronformat described in
271df930be7Sderaadt.Xr strftime 3 .
27292a6e69dSjmc.It Cm majflt
27392a6e69dSjmcTotal page faults.
27451ebac77Sguenther.It Cm maxrss
27551ebac77SguentherMaximum resident set size (in 1024 byte units).
27692a6e69dSjmc.It Cm minflt
27792a6e69dSjmcTotal page reclaims.
27892a6e69dSjmc.It Cm msgrcv
27992a6e69dSjmcTotal messages received (reads from pipes/sockets).
28092a6e69dSjmc.It Cm msgsnd
28192a6e69dSjmcTotal messages sent (writes on pipes/sockets).
28292a6e69dSjmc.It Cm nice
28392a6e69dSjmcAlias:
28492a6e69dSjmc.Cm ni .
285df930be7SderaadtThe process scheduling increment (see
286df930be7Sderaadt.Xr setpriority 2 ) .
28792a6e69dSjmc.It Cm nivcsw
28892a6e69dSjmcTotal involuntary context switches.
28992a6e69dSjmc.It Cm nsigs
29092a6e69dSjmcAlias:
29192a6e69dSjmc.Cm nsignals .
29292a6e69dSjmcTotal signals taken.
29392a6e69dSjmc.It Cm nswap
29492a6e69dSjmcTotal swaps in/out.
29592a6e69dSjmc.It Cm nvcsw
29692a6e69dSjmcTotal voluntary context switches.
29792a6e69dSjmc.It Cm nwchan
29892a6e69dSjmcWait channel (as an address).
29992a6e69dSjmc.It Cm oublk
30092a6e69dSjmcAlias:
30192a6e69dSjmc.Cm oublock .
30292a6e69dSjmcTotal blocks written.
30392a6e69dSjmc.It Cm p_ru
30492a6e69dSjmcResource usage (valid only for zombie processes).
30592a6e69dSjmc.It Cm paddr
30692a6e69dSjmcSwap address.
30792a6e69dSjmc.It Cm pagein
30892a6e69dSjmcPageins (same as
30992a6e69dSjmc.Cm majflt ) .
31092a6e69dSjmc.It Cm pgid
31192a6e69dSjmcProcess group number.
31292a6e69dSjmc.It Cm pid
31392a6e69dSjmcProcess ID.
31496110092Skn.It Cm pledge
31596110092SknComma separated list of active
31696110092Skn.Xr pledge 2
31796110092Sknpromises.
31892a6e69dSjmc.It Cm ppid
31992a6e69dSjmcParent process ID.
32092a6e69dSjmc.It Cm pri
32192a6e69dSjmcScheduling priority.
322447f61ceSguenther.It Cm procflags
323447f61ceSguentherThe process flags (in hexadecimal), as defined in the include file
324369bef3aSschwarze.In sys/proc.h :
325447f61ceSguenther.Bd -literal
326f7314e1cSclaudioPS_CONTROLT            0x1 process has a controlling
327f7314e1cSclaudio                           terminal
328447f61ceSguentherPS_EXEC                0x2 process called exec(3)
329f7314e1cSclaudioPS_INEXEC              0x4 process is doing an exec right
330f7314e1cSclaudio                           now
331447f61ceSguentherPS_EXITING             0x8 process is exiting
332f7314e1cSclaudioPS_SUGID              0x10 process had set ID privileges
333f7314e1cSclaudio                           since last exec
334447f61ceSguentherPS_SUGIDEXEC          0x20 last exec(3) was set[ug]id
335f7314e1cSclaudioPS_PPWAIT             0x40 parent is waiting for process
336f7314e1cSclaudio                           to exec/exit
337f7314e1cSclaudioPS_ISPWAIT            0x80 process is parent of PPWAIT
338f7314e1cSclaudio                           child
339447f61ceSguentherPS_PROFIL            0x100 process has started profiling
340447f61ceSguentherPS_TRACED            0x200 process is being traced
341f7314e1cSclaudioPS_WAITED            0x400 debugging process has waited
342f7314e1cSclaudio                           for child
343447f61ceSguentherPS_COREDUMP          0x800 busy coredumping
344447f61ceSguentherPS_SINGLEEXIT       0x1000 other threads must die
345447f61ceSguentherPS_SINGLEUNWIND     0x2000 other threads must unwind
346f7314e1cSclaudioPS_NOZOMBIE         0x4000 pid 1 waits for me instead of
347f7314e1cSclaudio                           dad
348fc20a59eSclaudioPS_STOPPING         0x8000 just stopped, need to send
349f7314e1cSclaudio                           SIGCHLD
350f7314e1cSclaudioPS_SYSTEM          0x10000 No signals, stats or swapping
351f7314e1cSclaudioPS_EMBRYO          0x20000 New process, not yet fledged
352f7314e1cSclaudioPS_ZOMBIE          0x40000 Dead and ready to be waited for
353f7314e1cSclaudioPS_NOBROADCASTKILL 0x80000 Process excluded from kill -1
3540bd1216cSderaadtPS_PLEDGE         0x100000 process has called pledge(2)
35506258058SrobPS_WXNEEDED	0x00200000 process allowed to violate W^X
35606258058SrobPS_EXECPLEDGE	0x00400000 has exec pledges
35706258058SrobPS_ORPHAN	0x00800000 process is on an orphan list
358b8bce0ffSderaadtPS_CHROOT	0x01000000 process is chrooted
359b8bce0ffSderaadtPS_NOBTCFI	0x02000000 no Branch Target CFI
360b7fe6922SclaudioPS_CONTINUED    0x20000000 process continued from stopped state
361b7fe6922Sclaudio                           but has not been waited for yet
362*85ce0bb8SclaudioPS_STOPPED      0x40000000 process is in stopped state
363447f61ceSguenther.Ed
36492a6e69dSjmc.It Cm re
36592a6e69dSjmcCore residency time (in seconds; 127 = infinity).
36692a6e69dSjmc.It Cm rgid
36792a6e69dSjmcReal group ID.
36892a6e69dSjmc.It Cm rgroup
36992a6e69dSjmcText name of real group ID.
37092a6e69dSjmc.It Cm rlink
37192a6e69dSjmcReverse link on run queue, or 0.
37292a6e69dSjmc.It Cm rss
373f81d96dfSaaronThe real memory (resident set) size of the process (in 1024 byte units).
37492a6e69dSjmc.It Cm rsz
37592a6e69dSjmcAlias:
37692a6e69dSjmc.Cm rssize .
37792a6e69dSjmcResident set size + (text size / text use count).
378a60854cdSguenther.It Cm rtable
379a60854cdSguentherRouting table.
38092a6e69dSjmc.It Cm ruid
38192a6e69dSjmcReal user ID.
38292a6e69dSjmc.It Cm ruser
38392a6e69dSjmcUser name (from
38492a6e69dSjmc.Cm ruid ) .
38592a6e69dSjmc.It Cm sess
386c59e78d3SclaudioSession ID (PID of session leader).
38792a6e69dSjmc.It Cm sig
38892a6e69dSjmcAlias:
38992a6e69dSjmc.Cm pending .
39092a6e69dSjmcPending signals.
39192a6e69dSjmc.It Cm sigcatch
39292a6e69dSjmcAlias:
39392a6e69dSjmc.Cm caught .
39492a6e69dSjmcCaught signals.
39592a6e69dSjmc.It Cm sigignore
39692a6e69dSjmcAlias:
39792a6e69dSjmc.Cm ignored .
39892a6e69dSjmcIgnored signals.
39992a6e69dSjmc.It Cm sigmask
40092a6e69dSjmcAlias:
40192a6e69dSjmc.Cm blocked .
40292a6e69dSjmcBlocked signals.
40392a6e69dSjmc.It Cm sl
40492a6e69dSjmcSleep time (in seconds; 127 = infinity).
40592a6e69dSjmc.It Cm ssiz
40692a6e69dSjmcStack size, in Kilobytes.
40792a6e69dSjmc.It Cm start
408df930be7SderaadtThe time the command started.
409df930be7SderaadtIf the command started less than 24 hours ago, the start time is
410b3119326Saarondisplayed using the
411b3119326Saaron.Dq %l:%M%p
412b3119326Saaronformat described in
413df930be7Sderaadt.Xr strftime 3 .
414df930be7SderaadtIf the command started less than 7 days ago, the start time is
415b3119326Saarondisplayed using the
416577b6846Sd.Dq %a%I%p
417b3119326Saaronformat.
418b3119326SaaronOtherwise, the start time is displayed using the
419b3119326Saaron.Dq %e%b%y
420b3119326Saaronformat.
42192a6e69dSjmc.It Cm state
42292a6e69dSjmcAlias:
42392a6e69dSjmc.Cm stat .
424df930be7SderaadtThe state is given by a sequence of letters, for example,
42592a6e69dSjmc.Dq RWN .
426df930be7SderaadtThe first letter indicates the run state of the process:
427df930be7Sderaadt.Pp
428df930be7Sderaadt.Bl -tag -width indent -compact
429df930be7Sderaadt.It D
430df930be7SderaadtMarks a process in disk (or other short term, uninterruptible) wait.
431df930be7Sderaadt.It I
432df930be7SderaadtMarks a process that is idle (sleeping for longer than about 20 seconds).
433df930be7Sderaadt.It R
434df930be7SderaadtMarks a runnable process.
435df930be7Sderaadt.It S
436df930be7SderaadtMarks a process that is sleeping for less than about 20 seconds.
437df930be7Sderaadt.It T
438df930be7SderaadtMarks a stopped process.
439df930be7Sderaadt.It Z
440b3119326SaaronMarks a dead process (a
4412a2cf0c3Sjmc.Dq zombie ) .
442df930be7Sderaadt.El
443df930be7Sderaadt.Pp
444df930be7SderaadtAdditional characters after these, if any, indicate additional state
445df930be7Sderaadtinformation:
446df930be7Sderaadt.Pp
447df930be7Sderaadt.Bl -tag -width indent -compact
448df930be7Sderaadt.It +
449a398fd9aSjmcThe process is in the foreground process group of its controlling
450a398fd9aSjmcterminal.
451c22e921bSjmc.It \*(Lt
45292a6e69dSjmcThe process has a raised CPU
45392a6e69dSjmcscheduling priority (see
45492a6e69dSjmc.Xr setpriority 2 ) .
455c22e921bSjmc.It \*(Gt
456df930be7SderaadtThe process has specified a soft limit on memory requirements and is
457df930be7Sderaadtcurrently exceeding that limit; such a process is (necessarily) not
458df930be7Sderaadtswapped.
459577b6846Sd.\" .It A
460577b6846Sd.\" the process has asked for random page replacement
461577b6846Sd.\" .Pf ( Dv MADV_RANDOM ,
462577b6846Sd.\" from
463577b6846Sd.\" .Xr madvise 2 ,
464577b6846Sd.\" for example,
465577b6846Sd.\" .Xr lisp 1
466577b6846Sd.\" in a garbage collect).
467f1e82477Srob.It c
468f1e82477SrobThe process is chrooted.
469df930be7Sderaadt.It E
470df930be7SderaadtThe process is trying to exit.
4713f2d366dSniklas.It K
4723f2d366dSniklasThe process is a kernel thread.
473df930be7Sderaadt.It N
47492a6e69dSjmcThe process has a reduced CPU
47592a6e69dSjmcscheduling priority.
4760bd1216cSderaadt.It p
4770bd1216cSderaadtThe process has called
4780bd1216cSderaadt.Xr pledge 2 .
479577b6846Sd.\" .It S
48092a6e69dSjmc.\" The process has asked for FIFO
481577b6846Sd.\" page replacement
482577b6846Sd.\" .Pf ( Dv MADV_SEQUENTIAL ,
483577b6846Sd.\" from
484577b6846Sd.\" .Xr madvise 2 ,
485577b6846Sd.\" for example, a large image processing program using virtual memory to
486577b6846Sd.\" sequentially address voluminous data).
487df930be7Sderaadt.It s
488df930be7SderaadtThe process is a session leader.
4899651cef0Sjmc.It U
4909651cef0SjmcThe process has unveiled, and
4919651cef0Sjmc.Xr unveil 2
4929651cef0Sjmcis now locked.
4939651cef0Sjmc.It u
4949651cef0SjmcThe process has unveiled, but not yet locked
4959651cef0Sjmc.Xr unveil 2
4969651cef0Sjmc(could be a program error).
497df930be7Sderaadt.It V
498df930be7SderaadtThe process is suspended during a
49926d98fa4Sderaadt.Xr vfork 2 .
500df930be7Sderaadt.It X
501df930be7SderaadtThe process is being traced or debugged.
502970ac3e4Sderaadt.It / Ns Ar n
503970ac3e4SderaadtOn multiprocessor machines, specifies processor number
504970ac3e4Sderaadt.Ar n .
505df930be7Sderaadt.El
506ba85321fSchrisz.It Cm supgid
507ba85321fSchriszGroup IDs of supplementary groups.
508ba85321fSchrisz.It Cm supgrp
509ba85321fSchriszGroup names of supplementary groups.
51092a6e69dSjmc.It Cm svgid
51192a6e69dSjmcSaved GID from a setgid executable.
51292a6e69dSjmc.It Cm svuid
51392a6e69dSjmcSaved UID from a setuid executable.
51492a6e69dSjmc.It Cm tdev
515a398fd9aSjmcControlling terminal device number.
516d1dac99bSbenno.It Cm tid
517d1dac99bSbennoThread ID.
518d1dac99bSbennoUsed together with
519d1dac99bSbenno.Fl H .
52092a6e69dSjmc.It Cm time
52192a6e69dSjmcAlias:
52292a6e69dSjmc.Cm cputime .
52392a6e69dSjmcAccumulated CPU time, user + system.
52492a6e69dSjmc.It Cm tpgid
525a398fd9aSjmcControlling terminal process group ID.
52692a6e69dSjmc.\".It trss
52792a6e69dSjmc.\"Text resident set size, in Kilobytes.
52892a6e69dSjmc.It Cm tsess
529a398fd9aSjmcControlling terminal session pointer.
53092a6e69dSjmc.It Cm tsiz
53192a6e69dSjmcText size, in Kilobytes.
53292a6e69dSjmc.It Cm tt
533df930be7SderaadtAn abbreviation for the pathname of the controlling terminal, if any.
534df930be7SderaadtThe abbreviation consists of the two letters following
5357adfd4aeSjmc.Dq /dev/tty ,
536b3119326Saaronor, for the console,
537b3119326Saaron.Dq co .
538b3119326SaaronThis is followed by a
5397adfd4aeSjmc.Sq -
540b3119326Saaronif the process can no longer reach that
54192a6e69dSjmccontrolling terminal (i.e. it has been revoked).
54292a6e69dSjmc.It Cm tty
543a398fd9aSjmcFull name of controlling terminal.
54492a6e69dSjmc.It Cm ucomm
54592a6e69dSjmcAlias:
54692a6e69dSjmc.Cm comm .
54792a6e69dSjmcName to be used for accounting.
54892a6e69dSjmc.It Cm uid
54992a6e69dSjmcEffective user ID.
55092a6e69dSjmc.It Cm upr
55192a6e69dSjmcAlias:
55292a6e69dSjmc.Cm usrpri .
55392a6e69dSjmcScheduling priority on return from system call.
55492a6e69dSjmc.It Cm user
55592a6e69dSjmcUser name (from
55692a6e69dSjmc.Cm uid ) .
55792a6e69dSjmc.It Cm vsz
55892a6e69dSjmcAlias:
55992a6e69dSjmc.Cm vsize .
56092a6e69dSjmcVirtual size, in Kilobytes.
56192a6e69dSjmc.It Cm wchan
562df930be7SderaadtThe event (an address in the system) on which a process waits.
563df930be7SderaadtWhen printed numerically, the initial part of the address is
5648c926583Saarontrimmed off and the result is printed in hex; for example, 0x80324000 prints
565df930be7Sderaadtas 324000.
56692a6e69dSjmc.It Cm xstat
56792a6e69dSjmcExit or stop status (valid only for stopped or zombie process).
568df930be7Sderaadt.El
569c2e41e89Sguenther.Sh ENVIRONMENT
570c2e41e89SguentherThe following environment variables affect the execution of
571c2e41e89Sguenther.Nm :
5726008a705Sschwarze.Bl -tag -width LC_CTYPE
573c2e41e89Sguenther.It Ev COLUMNS
5747220d8ecSbentleyIf set to a positive integer,
5757220d8ecSbentleyoutput is formatted to the given width in columns.
5767220d8ecSbentleyOtherwise,
577c2e41e89Sguenther.Nm
5780a833eadSschwarzedefaults to the terminal width minus 1.
5790a833eadSschwarzeIf none of
580511be169Sbentley.Dv stdout ,
5810a833eadSschwarze.Dv stderr ,
582511be169Sbentleyand
583511be169Sbentley.Dv stdin
5840a833eadSschwarzeare a terminal,
5850a833eadSschwarze79 columns are used.
5866008a705Sschwarze.It Ev LC_CTYPE
5876008a705SschwarzeThe character encoding
5886008a705Sschwarze.Xr locale 1 .
5896008a705SschwarzeIt decides which byte sequences form characters,
5906008a705Sschwarzewhich characters are printable, and what their display width is.
5916008a705SschwarzeIf unset or set to
5926008a705Sschwarze.Qq C ,
5936008a705Sschwarze.Qq POSIX ,
5946008a705Sschwarzeor an unsupported value, only printable ASCII characters are printed.
5956008a705SschwarzeTabs, newlines, non-printable ASCII characters, and non-ASCII bytes
5966008a705Sschwarzeare encoded with
5976008a705Sschwarze.Xr vis 3 .
5986008a705SschwarzeIf UTF-8 output is enabled, valid characters that are not printable
5996008a705Sschwarzeare replaced with the Unicode replacement character U+FFFD.
6006008a705SschwarzeThese rules for example apply to command names, arguments, and
6016008a705Sschwarzeenvironments and to directory, user, and group names.
602c2e41e89Sguenther.It Ev TZ
603c2e41e89SguentherThe time zone to use when displaying dates.
604c2e41e89SguentherSee
605c2e41e89Sguenther.Xr environ 7
606c2e41e89Sguentherfor more information.
607c2e41e89Sguenther.El
608df930be7Sderaadt.Sh FILES
6092b9d9afcSjmc.Bl -tag -width "/var/db/kvm_bsd.dbXXX" -compact
610df930be7Sderaadt.It Pa /dev
611df930be7Sderaadtspecial files and device names
612460cff61Sccappuc.It Pa /var/db/kvm_bsd.db
613df930be7Sderaadtsystem namelist database
6142b9d9afcSjmc.It Pa /var/run/dev.db
6152b9d9afcSjmc.Pa /dev
6162b9d9afcSjmcname database
617df930be7Sderaadt.El
61859a5f2b9Sjmc.Sh EXIT STATUS
61959a5f2b9Sjmc.Ex -std ps
6202a2cf0c3Sjmc.Sh EXAMPLES
621fee6b56aSjmcDisplay information on all system processes:
6222a2cf0c3Sjmc.Pp
623fee6b56aSjmc.Dl $ ps -auxw
624df930be7Sderaadt.Sh SEE ALSO
62549a23b5aSjmc.Xr fstat 1 ,
626df930be7Sderaadt.Xr kill 1 ,
627df9e602bSjmc.Xr netstat 1 ,
628d30f3c97Sjmc.Xr pgrep 1 ,
629d30f3c97Sjmc.Xr pkill 1 ,
630375ad104Sjmc.Xr procmap 1 ,
631df9e602bSjmc.Xr systat 1 ,
6323b62d2f3Spjanzen.Xr top 1 ,
633df930be7Sderaadt.Xr w 1 ,
634df930be7Sderaadt.Xr kvm 3 ,
635df930be7Sderaadt.Xr strftime 3 ,
6360c64f58aSjmc.Xr dev_mkdb 8 ,
637df9e602bSjmc.Xr iostat 8 ,
638df9e602bSjmc.Xr pstat 8 ,
639df9e602bSjmc.Xr vmstat 8
6400f3f4dbcSjmc.Sh STANDARDS
6410f3f4dbcSjmcThe
6420f3f4dbcSjmc.Nm
6430f3f4dbcSjmcutility is compliant with the
64499332e38Sjmc.St -p1003.1-2008
64574ac760dSjmcspecification,
64674ac760dSjmcexcept that the flag
64774ac760dSjmc.Op Fl G
648c2e41e89Sguentheris unsupported and
649d967b8e3Sjmcthe flags
650d967b8e3Sjmc.Op Fl ptU
651c2e41e89Sguenthersupport only single arguments, not lists.
6520f3f4dbcSjmc.Pp
6530f3f4dbcSjmcThe flags
65474ac760dSjmc.Op Fl defglnu
65574ac760dSjmcare marked by
65674ac760dSjmc.St -p1003.1-2008
657f3e2f783Sjmcas being an X/Open System Interfaces option.
658f3e2f783SjmcOf these,
65974ac760dSjmc.Op Fl dfgn
66074ac760dSjmcare not supported by this implementation of
661f3e2f783Sjmc.Nm ;
662f3e2f783Sjmcbehaviour for the flags
663f3e2f783Sjmc.Op Fl elu
664f3e2f783Sjmcdiffers between this implementation and the
665f3e2f783SjmcX/Open System Interfaces option of
66674ac760dSjmc.St -p1003.1-2008 .
66774ac760dSjmc.Pp
66874ac760dSjmcThe flags
66924ca0f25Sjob.Op Fl cfHhjkLMmNOrSTvWwx
67074ac760dSjmcare extensions to
671c2608f17Sjmc.St -p1003.1-2008 .
6729ddbe632Sjmc.Pp
6739ddbe632SjmcOnly the following keywords are recognised by
6749ddbe632Sjmc.St -p1003.1-2008 :
6759ddbe632Sjmc.Cm args ,
6769ddbe632Sjmc.Cm comm ,
6779ddbe632Sjmc.Cm etime ,
6789ddbe632Sjmc.Cm group ,
6799ddbe632Sjmc.Cm nice ,
6809ddbe632Sjmc.Cm pcpu ,
6819ddbe632Sjmc.Cm pgid ,
6829ddbe632Sjmc.Cm pid ,
6839ddbe632Sjmc.Cm ppid ,
6849ddbe632Sjmc.Cm rgroup ,
6859ddbe632Sjmc.Cm ruser ,
6869ddbe632Sjmc.Cm time ,
6879ddbe632Sjmc.Cm tty ,
6889ddbe632Sjmc.Cm user ,
6899ddbe632Sjmcand
6909ddbe632Sjmc.Cm vsz .
691b5791b49Smickey.Sh HISTORY
692b5791b49SmickeyA
693b5791b49Smickey.Nm
6948674f99aSschwarzecommand first appeared in
6958674f99aSschwarze.At v3 .
69692a6e69dSjmc.Sh CAVEATS
69792a6e69dSjmcWhen printing using the
69892a6e69dSjmc.Cm command
69992a6e69dSjmckeyword, a process that has exited and
70092a6e69dSjmchas a parent that has not yet waited for the process (in other words, a zombie)
70192a6e69dSjmcis listed as
70292a6e69dSjmc.Dq Aq defunct ,
70392a6e69dSjmcand a process which is blocked while trying
70492a6e69dSjmcto exit is listed as
70592a6e69dSjmc.Dq Aq exiting .
70692a6e69dSjmc.Nm
70792a6e69dSjmcmakes an educated guess as to the file name and arguments given when the
70892a6e69dSjmcprocess was created by examining memory or the swap area.
70992a6e69dSjmcThe method is inherently somewhat unreliable and in any event a process
71092a6e69dSjmcis entitled to destroy this information, so the names cannot be depended
71192a6e69dSjmcon too much.
71292a6e69dSjmcThe
71392a6e69dSjmc.Cm ucomm
71492a6e69dSjmc(accounting) keyword can, however, be depended on.
7150222674fStedu.Pp
7160222674fSteduThe information displayed is only a snapshot of a constantly changing system.
717