xref: /freebsd/bin/ps/ps.1 (revision b3178949eeed91db089f4d5a9cfdd019660db40b)
19ddb49cbSWarner Losh.\"-
24b88c807SRodney W. Grimes.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
34b88c807SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
44b88c807SRodney W. Grimes.\"
54b88c807SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
64b88c807SRodney W. Grimes.\" modification, are permitted provided that the following conditions
74b88c807SRodney W. Grimes.\" are met:
84b88c807SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
94b88c807SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
104b88c807SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
114b88c807SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
124b88c807SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
134b88c807SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
144b88c807SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
154b88c807SRodney W. Grimes.\"    without specific prior written permission.
164b88c807SRodney W. Grimes.\"
174b88c807SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
184b88c807SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
194b88c807SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
204b88c807SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
214b88c807SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
224b88c807SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
234b88c807SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
244b88c807SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
254b88c807SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
264b88c807SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
274b88c807SRodney W. Grimes.\" SUCH DAMAGE.
284b88c807SRodney W. Grimes.\"
294b88c807SRodney W. Grimes.\"     @(#)ps.1	8.3 (Berkeley) 4/18/94
302a456239SPeter Wemm.\" $FreeBSD$
314b88c807SRodney W. Grimes.\"
329acd9127SEdward Tomasz Napierala.Dd June 14, 2011
334b88c807SRodney W. Grimes.Dt PS 1
34caa2db3bSRuslan Ermilov.Os
354b88c807SRodney W. Grimes.Sh NAME
36c9a8d1f4SPhilippe Charnier.Nm ps
374b88c807SRodney W. Grimes.Nd process status
384b88c807SRodney W. Grimes.Sh SYNOPSIS
39be8b1497SRuslan Ermilov.Nm
40044fce53SBrian Somers.Op Fl aCcdefHhjlmrSTuvwXxZ
41a89237aeSRuslan Ermilov.Op Fl O Ar fmt | Fl o Ar fmt
42287d1861SRuslan Ermilov.Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ...
434b88c807SRodney W. Grimes.Op Fl M Ar core
444b88c807SRodney W. Grimes.Op Fl N Ar system
45287d1861SRuslan Ermilov.Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ...
46287d1861SRuslan Ermilov.Op Fl t Ar tty Ns Op , Ns Ar tty Ns Ar ...
47a89237aeSRuslan Ermilov.Op Fl U Ar user Ns Op , Ns Ar user Ns Ar ...
48be8b1497SRuslan Ermilov.Nm
494b88c807SRodney W. Grimes.Op Fl L
504b88c807SRodney W. Grimes.Sh DESCRIPTION
51e004acc8SPhilippe CharnierThe
52e004acc8SPhilippe Charnier.Nm
53e004acc8SPhilippe Charnierutility
548ed0d42fSGarance A Drosehndisplays a header line, followed by lines containing information about
558ed0d42fSGarance A Drosehnall of your
564b88c807SRodney W. Grimesprocesses that have controlling terminals.
574b88c807SRodney W. Grimes.Pp
58a4c8a745SGarance A DrosehnA different set of processes can be selected for display by using any
59a4c8a745SGarance A Drosehncombination of the
60287d1861SRuslan Ermilov.Fl a , G , p , T , t ,
61a4c8a745SGarance A Drosehnand
62a4c8a745SGarance A Drosehn.Fl U
63a4c8a745SGarance A Drosehnoptions.
64a4c8a745SGarance A DrosehnIf more than one of these options are given, then
65a4c8a745SGarance A Drosehn.Nm
66a4c8a745SGarance A Drosehnwill select all processes which are matched by at least one of the
67a4c8a745SGarance A Drosehngiven options.
68a4c8a745SGarance A Drosehn.Pp
698ed0d42fSGarance A DrosehnFor the processes which have been selected for display,
708ed0d42fSGarance A Drosehn.Nm
718ed0d42fSGarance A Drosehnwill usually display one line per process.
728ed0d42fSGarance A DrosehnThe
738ed0d42fSGarance A Drosehn.Fl H
748ed0d42fSGarance A Drosehnoption may result in multiple output lines (one line per thread) for
758ed0d42fSGarance A Drosehnsome processes.
768ed0d42fSGarance A DrosehnBy default all of these output lines are sorted first by controlling
77287d1861SRuslan Ermilovterminal, then by process ID.
788ed0d42fSGarance A DrosehnThe
798ed0d42fSGarance A Drosehn.Fl m , r , u ,
808ed0d42fSGarance A Drosehnand
818ed0d42fSGarance A Drosehn.Fl v
828ed0d42fSGarance A Drosehnoptions will change the sort order.
838ed0d42fSGarance A DrosehnIf more than one sorting option was given, then the selected processes
848ed0d42fSGarance A Drosehnwill be sorted by the last sorting option which was specified.
858ed0d42fSGarance A Drosehn.Pp
86a4c8a745SGarance A DrosehnFor the processes which have been selected for display, the information
87a4c8a745SGarance A Drosehnto display is selected based on a set of keywords (see the
88287d1861SRuslan Ermilov.Fl L , O ,
894b88c807SRodney W. Grimesand
904b88c807SRodney W. Grimes.Fl o
914b88c807SRodney W. Grimesoptions).
92287d1861SRuslan ErmilovThe default output format includes, for each process, the process' ID,
93287d1861SRuslan Ermilovcontrolling terminal, CPU time (including both user and system time),
944b88c807SRodney W. Grimesstate, and associated command.
954b88c807SRodney W. Grimes.Pp
961c0c7731SJoerg WunschThe process file system (see
9746be34b9SKris Kennaway.Xr procfs 5 )
9846be34b9SKris Kennawayshould be mounted when
991c0c7731SJoerg Wunsch.Nm
1001c0c7731SJoerg Wunschis executed, otherwise not all information will be available.
1011c0c7731SJoerg Wunsch.Pp
1024b88c807SRodney W. GrimesThe options are as follows:
1034b88c807SRodney W. Grimes.Bl -tag -width indent
1044b88c807SRodney W. Grimes.It Fl a
1054b88c807SRodney W. GrimesDisplay information about other users' processes as well as your own.
106fa6c8d89SMaxim KonovalovThis will skip any processes which do not have a controlling terminal,
107a4c8a745SGarance A Drosehnunless the
108a4c8a745SGarance A Drosehn.Fl x
109a4c8a745SGarance A Drosehnoption is also specified.
1107fa34c11SDima DorfmanThis can be disabled by setting the
111d883e289SJosef Karthauser.Va security.bsd.see_other_uids
1126b821228SDima Dorfmansysctl to zero.
113db91faacSPeter Wemm.It Fl c
114287d1861SRuslan ErmilovChange the
115287d1861SRuslan Ermilov.Dq command
116287d1861SRuslan Ermilovcolumn output to just contain the executable name,
117db91faacSPeter Wemmrather than the full command line.
1184b88c807SRodney W. Grimes.It Fl C
119287d1861SRuslan ErmilovChange the way the CPU percentage is calculated by using a
120287d1861SRuslan Ermilov.Dq raw
121287d1861SRuslan ErmilovCPU calculation that ignores
122287d1861SRuslan Ermilov.Dq resident
123287d1861SRuslan Ermilovtime (this normally has
1244b88c807SRodney W. Grimesno effect).
125044fce53SBrian Somers.It Fl d
126044fce53SBrian SomersArrange processes into descendancy order and prefix each command with
127044fce53SBrian Somersindentation text showing sibling and parent/child relationships.
128044fce53SBrian SomersIf either of the
129044fce53SBrian Somers.Fl m
130044fce53SBrian Somersand
131044fce53SBrian Somers.Fl r
132044fce53SBrian Somersoptions are also used, they control how sibling processes are sorted
133044fce53SBrian Somersrelative to each other.
134b9ff20abSEdward Tomasz NapieralaNote that this option has no effect if the
135b9ff20abSEdward Tomasz Napierala.Dq command
136b9ff20abSEdward Tomasz Napieralacolumn is not the last column displayed.
1374b88c807SRodney W. Grimes.It Fl e
1384b88c807SRodney W. GrimesDisplay the environment as well.
139b548141bSJohn Dyson.It Fl f
14077027e30SJoseph KoshyShow commandline and environment information about swapped out processes.
141287d1861SRuslan ErmilovThis option is honored only if the UID of the user is 0.
142a4c8a745SGarance A Drosehn.It Fl G
143a4c8a745SGarance A DrosehnDisplay information about processes which are running with the specified
144287d1861SRuslan Ermilovreal group IDs.
14548b8c0deSScott Long.It Fl H
14648b8c0deSScott LongShow all of the
14748b8c0deSScott Long.Em kernel visible
148287d1861SRuslan Ermilovthreads associated with each process.
149287d1861SRuslan ErmilovDepending on the threading package that
15048b8c0deSScott Longis in use, this may show only the process, only the kernel scheduled entities,
15148b8c0deSScott Longor all of the process threads.
1524b88c807SRodney W. Grimes.It Fl h
1534b88c807SRodney W. GrimesRepeat the information header as often as necessary to guarantee one
1544b88c807SRodney W. Grimesheader per page of information.
1554b88c807SRodney W. Grimes.It Fl j
1564b88c807SRodney W. GrimesPrint information associated with the following keywords:
157259fcfacSGarance A Drosehn.Cm user , pid , ppid , pgid , sid , jobc , state , tt , time ,
158287d1861SRuslan Ermilovand
159287d1861SRuslan Ermilov.Cm command .
1604b88c807SRodney W. Grimes.It Fl L
1618ed0d42fSGarance A DrosehnList the set of keywords available for the
1628ed0d42fSGarance A Drosehn.Fl O
1638ed0d42fSGarance A Drosehnand
1648ed0d42fSGarance A Drosehn.Fl o
1658ed0d42fSGarance A Drosehnoptions.
1664b88c807SRodney W. Grimes.It Fl l
1674b88c807SRodney W. GrimesDisplay information associated with the following keywords:
168287d1861SRuslan Ermilov.Cm uid , pid , ppid , cpu , pri , nice , vsz , rss , mwchan , state ,
169287d1861SRuslan Ermilov.Cm tt , time ,
170287d1861SRuslan Ermilovand
171287d1861SRuslan Ermilov.Cm command .
1724b88c807SRodney W. Grimes.It Fl M
1734b88c807SRodney W. GrimesExtract values associated with the name list from the specified core
174cd31922fSRuslan Ermilovinstead of the currently running system.
1754b88c807SRodney W. Grimes.It Fl m
1768ed0d42fSGarance A DrosehnSort by memory usage, instead of the combination of controlling
177287d1861SRuslan Ermilovterminal and process ID.
1784b88c807SRodney W. Grimes.It Fl N
179f9a480abSRuslan ErmilovExtract the name list from the specified system instead of the default,
180f9a480abSRuslan Ermilovwhich is the kernel image the system has booted from.
1814b88c807SRodney W. Grimes.It Fl O
1824b88c807SRodney W. GrimesAdd the information associated with the space or comma separated list
183287d1861SRuslan Ermilovof keywords specified, after the process ID,
1844b88c807SRodney W. Grimesin the default information
1854b88c807SRodney W. Grimesdisplay.
186287d1861SRuslan ErmilovKeywords may be appended with an equals
187287d1861SRuslan Ermilov.Pq Ql =
188287d1861SRuslan Ermilovsign and a string.
1894b88c807SRodney W. GrimesThis causes the printed header to use the specified string instead of
1904b88c807SRodney W. Grimesthe standard header.
1914b88c807SRodney W. Grimes.It Fl o
1922dda9fe9SJuli MallettDisplay information associated with the space or comma separated
1932dda9fe9SJuli Mallettlist of keywords specified.
19461b92b9aSYaroslav TykhiyThe last keyword in the list may be appended with an equals
19561b92b9aSYaroslav Tykhiy.Pq Ql =
1969badf57fSRuslan Ermilovsign and a string that spans the rest of the argument, and can contain
1977c5169efSYaroslav Tykhiyspace and comma characters.
19861b92b9aSYaroslav TykhiyThis causes the printed header to use the specified string instead of
19961b92b9aSYaroslav Tykhiythe standard header.
20050355bb4SJuli MallettMultiple keywords may also be given in the form of more than one
20150355bb4SJuli Mallett.Fl o
20250355bb4SJuli Mallettoption.
20361b92b9aSYaroslav TykhiySo the header texts for multiple keywords can be changed.
2046aac4c27SXin LIIf all keywords have empty header texts, no header line is written.
2054b88c807SRodney W. Grimes.It Fl p
206287d1861SRuslan ErmilovDisplay information about processes which match the specified process IDs.
2074b88c807SRodney W. Grimes.It Fl r
208287d1861SRuslan ErmilovSort by current CPU usage, instead of the combination of controlling
209287d1861SRuslan Ermilovterminal and process ID.
2104b88c807SRodney W. Grimes.It Fl S
211a870bf2cSKonstantin BelousovChange the way the process times, namely cputime, systime, and usertime,
212a870bf2cSKonstantin Belousovare calculated by summing all exited children to their parent process.
2134b88c807SRodney W. Grimes.It Fl T
2144b88c807SRodney W. GrimesDisplay information about processes attached to the device associated
2154b88c807SRodney W. Grimeswith the standard input.
2164b88c807SRodney W. Grimes.It Fl t
2174b88c807SRodney W. GrimesDisplay information about processes attached to the specified terminal
218287d1861SRuslan Ermilovdevices.
21973eb8310SPeter Wemm.It Fl U
220287d1861SRuslan ErmilovDisplay the processes belonging to the specified usernames.
2214b88c807SRodney W. Grimes.It Fl u
2224b88c807SRodney W. GrimesDisplay information associated with the following keywords:
223287d1861SRuslan Ermilov.Cm user , pid , %cpu , %mem , vsz , rss , tt , state , start , time ,
224287d1861SRuslan Ermilovand
225287d1861SRuslan Ermilov.Cm command .
2264b88c807SRodney W. GrimesThe
2274b88c807SRodney W. Grimes.Fl u
2284b88c807SRodney W. Grimesoption implies the
2294b88c807SRodney W. Grimes.Fl r
2304b88c807SRodney W. Grimesoption.
2314b88c807SRodney W. Grimes.It Fl v
2324b88c807SRodney W. GrimesDisplay information associated with the following keywords:
233287d1861SRuslan Ermilov.Cm pid , state , time , sl , re , pagein , vsz , rss , lim , tsiz ,
234287d1861SRuslan Ermilov.Cm %cpu , %mem ,
235287d1861SRuslan Ermilovand
236287d1861SRuslan Ermilov.Cm command .
2374b88c807SRodney W. GrimesThe
2384b88c807SRodney W. Grimes.Fl v
2394b88c807SRodney W. Grimesoption implies the
2404b88c807SRodney W. Grimes.Fl m
2414b88c807SRodney W. Grimesoption.
2424b88c807SRodney W. Grimes.It Fl w
2434b88c807SRodney W. GrimesUse 132 columns to display information, instead of the default which
2444b88c807SRodney W. Grimesis your window size.
2454b88c807SRodney W. GrimesIf the
2464b88c807SRodney W. Grimes.Fl w
2474b88c807SRodney W. Grimesoption is specified more than once,
248c9a8d1f4SPhilippe Charnier.Nm
2494b88c807SRodney W. Grimeswill use as many columns as necessary without regard for your window size.
250b9ff20abSEdward Tomasz NapieralaNote that this option has no effect if the
251b9ff20abSEdward Tomasz Napierala.Dq command
252b9ff20abSEdward Tomasz Napieralacolumn is not the last column displayed.
253a4c8a745SGarance A Drosehn.It Fl X
254a4c8a745SGarance A DrosehnWhen displaying processes matched by other options, skip any processes
255a4c8a745SGarance A Drosehnwhich do not have a controlling terminal.
256b9ff20abSEdward Tomasz NapieralaThis is the default behaviour.
2574b88c807SRodney W. Grimes.It Fl x
258a4c8a745SGarance A DrosehnWhen displaying processes matched by other options, include processes
259a4c8a745SGarance A Drosehnwhich do not have a controlling terminal.
260a4c8a745SGarance A DrosehnThis is the opposite of the
261a4c8a745SGarance A Drosehn.Fl X
262a4c8a745SGarance A Drosehnoption.
263a4c8a745SGarance A DrosehnIf both
264a4c8a745SGarance A Drosehn.Fl X
265a4c8a745SGarance A Drosehnand
266a4c8a745SGarance A Drosehn.Fl x
267a4c8a745SGarance A Drosehnare specified in the same command, then
268a4c8a745SGarance A Drosehn.Nm
269a4c8a745SGarance A Drosehnwill use the one which was specified last.
2707304f61fSBrian Feldman.It Fl Z
271ac06cb0aSRobert WatsonAdd
272ac06cb0aSRobert Watson.Xr mac 4
273ac06cb0aSRobert Watsonlabel to the list of keywords for which
2747304f61fSBrian Feldman.Nm
2757304f61fSBrian Feldmanwill display information.
2764b88c807SRodney W. Grimes.El
2774b88c807SRodney W. Grimes.Pp
2784b88c807SRodney W. GrimesA complete list of the available keywords are listed below.
2794b88c807SRodney W. GrimesSome of these keywords are further specified as follows:
2800d632649SJohn Baldwin.Bl -tag -width lockname
281287d1861SRuslan Ermilov.It Cm %cpu
282287d1861SRuslan ErmilovThe CPU utilization of the process; this is a decaying average over up to
2834b88c807SRodney W. Grimesa minute of previous (real) time.
2844b88c807SRodney W. GrimesSince the time base over which this is computed varies (since processes may
2854b88c807SRodney W. Grimesbe very young) it is possible for the sum of all
286287d1861SRuslan Ermilov.Cm %cpu
2874b88c807SRodney W. Grimesfields to exceed 100%.
288287d1861SRuslan Ermilov.It Cm %mem
2894b88c807SRodney W. GrimesThe percentage of real memory used by this process.
2907123f4cdSEdward Tomasz Napierala.It Cm class
2917123f4cdSEdward Tomasz NapieralaLogin class associated with the process.
292287d1861SRuslan Ermilov.It Cm flags
293c01bf97cSSujal PatelThe flags associated with the process as in
2944b88c807SRodney W. Grimesthe include file
295fe08efe6SRuslan Ermilov.In sys/proc.h :
2967117b3d5SKonstantin Belousov.Bl -column P_SINGLE_BOUNDARY 0x40000000
297c01bf97cSSujal Patel.It Dv "P_ADVLOCK" Ta No "0x00001	Process may hold a POSIX advisory lock"
298c01bf97cSSujal Patel.It Dv "P_CONTROLT" Ta No "0x00002	Has a controlling terminal"
299bcf85d67SColin Percival.It Dv "P_KTHREAD" Ta No "0x00004	Kernel thread"
300f5f3977bSKonstantin Belousov.It Dv "P_FOLLOWFORK" Ta No "0x00008	Attach debugger to new children"
301c01bf97cSSujal Patel.It Dv "P_PPWAIT" Ta No "0x00010	Parent is waiting for child to exec/exit"
302c01bf97cSSujal Patel.It Dv "P_PROFIL" Ta No "0x00020	Has started profiling"
303bcf85d67SColin Percival.It Dv "P_STOPPROF" Ta No "0x00040	Has thread in requesting to stop prof"
3049abcf93aSSergey Kandaurov.It Dv "P_HADTHREADS" Ta No "0x00080	Has had threads (no cleanup shortcuts)"
305c01bf97cSSujal Patel.It Dv "P_SUGID" Ta No "0x00100		Had set id privileges since last exec"
306c01bf97cSSujal Patel.It Dv "P_SYSTEM" Ta No "0x00200	System proc: no sigs, stats or swapping"
307bcf85d67SColin Percival.It Dv "P_SINGLE_EXIT" Ta No "0x00400	Threads suspending should exit, not wait"
308c01bf97cSSujal Patel.It Dv "P_TRACED" Ta No "0x00800	Debugged process being traced"
309bcf85d67SColin Percival.It Dv "P_WAITED" Ta No "0x01000	Someone is waiting for us"
310c01bf97cSSujal Patel.It Dv "P_WEXIT" Ta No "0x02000		Working on exiting"
311c01bf97cSSujal Patel.It Dv "P_EXEC" Ta No "0x04000		Process called exec"
3129b0b5292SKonstantin Belousov.It Dv "P_WKILLED" Ta No "0x08000	Killed, shall go to kernel/user boundary ASAP"
313bcf85d67SColin Percival.It Dv "P_CONTINUED" Ta No "0x10000	Proc has continued from a stopped state"
314bcf85d67SColin Percival.It Dv "P_STOPPED_SIG" Ta No "0x20000	Stopped due to SIGSTOP/SIGTSTP"
315bcf85d67SColin Percival.It Dv "P_STOPPED_TRACE" Ta No "0x40000	Stopped because of tracing"
316bcf85d67SColin Percival.It Dv "P_STOPPED_SINGLE" Ta No "0x80000	Only one thread can continue"
317bcf85d67SColin Percival.It Dv "P_PROTECTED" Ta No "0x100000	Do not kill on memory overcommit"
318bcf85d67SColin Percival.It Dv "P_SIGEVENT" Ta No "0x200000	Process pending signals changed"
3197117b3d5SKonstantin Belousov.It Dv "P_SINGLE_BOUNDARY" Ta No "0x400000	Threads should suspend at user boundary"
3207117b3d5SKonstantin Belousov.It Dv "P_HWPMC" Ta No "0x800000	Process is using HWPMCs"
321bcf85d67SColin Percival.It Dv "P_JAILED" Ta No "0x1000000	Process is in jail"
322bcf85d67SColin Percival.It Dv "P_INEXEC" Ta No "0x4000000	Process is in execve()"
3237117b3d5SKonstantin Belousov.It Dv "P_STATCHILD" Ta No "0x8000000	Child process stopped or exited"
3247117b3d5SKonstantin Belousov.It Dv "P_INMEM" Ta No "0x10000000	Loaded into memory"
3257117b3d5SKonstantin Belousov.It Dv "P_SWAPPINGOUT" Ta No "0x20000000	Process is being swapped out"
3267117b3d5SKonstantin Belousov.It Dv "P_SWAPPINGIN" Ta No "0x40000000	Process is being swapped in"
3274b88c807SRodney W. Grimes.El
328287d1861SRuslan Ermilov.It Cm label
3292af538ebSRobert WatsonThe MAC label of the process.
330287d1861SRuslan Ermilov.It Cm lim
3314b88c807SRodney W. GrimesThe soft limit on memory used, specified via a call to
3324b88c807SRodney W. Grimes.Xr setrlimit 2 .
333287d1861SRuslan Ermilov.It Cm lstart
334287d1861SRuslan ErmilovThe exact time the command started, using the
335287d1861SRuslan Ermilov.Ql %c
336287d1861SRuslan Ermilovformat described in
3374b88c807SRodney W. Grimes.Xr strftime 3 .
338287d1861SRuslan Ermilov.It Cm lockname
3390d632649SJohn BaldwinThe name of the lock that the process is currently blocked on.
3409b67ac59SJohn BaldwinIf the name is invalid or unknown, then
34112e720d7SRuslan Ermilov.Dq ???\&
3429b67ac59SJohn Baldwinis displayed.
3436aac4c27SXin LI.It Cm logname
3446aac4c27SXin LIThe login name associated with the session the process is in (see
3456aac4c27SXin LI.Xr getlogin 2 ) .
346287d1861SRuslan Ermilov.It Cm mwchan
3470d632649SJohn BaldwinThe event name if the process is blocked normally, or the lock name if
3480d632649SJohn Baldwinthe process is blocked on a lock.
3490d632649SJohn BaldwinSee the wchan and lockname keywords
350d9a5f890SMatthew Dillonfor details.
351287d1861SRuslan Ermilov.It Cm nice
3524b88c807SRodney W. GrimesThe process scheduling increment (see
3534b88c807SRodney W. Grimes.Xr setpriority 2 ) .
354287d1861SRuslan Ermilov.It Cm rss
3554b88c807SRodney W. Grimesthe real memory (resident set) size of the process (in 1024 byte units).
356287d1861SRuslan Ermilov.It Cm start
3574b88c807SRodney W. GrimesThe time the command started.
3584b88c807SRodney W. GrimesIf the command started less than 24 hours ago, the start time is
359287d1861SRuslan Ermilovdisplayed using the
360287d1861SRuslan Ermilov.Dq Li %l:ps.1p
361287d1861SRuslan Ermilovformat described in
3624b88c807SRodney W. Grimes.Xr strftime 3 .
3634b88c807SRodney W. GrimesIf the command started less than 7 days ago, the start time is
364287d1861SRuslan Ermilovdisplayed using the
365287d1861SRuslan Ermilov.Dq Li %a6.15p
366287d1861SRuslan Ermilovformat.
367287d1861SRuslan ErmilovOtherwise, the start time is displayed using the
368287d1861SRuslan Ermilov.Dq Li %e%b%y
369287d1861SRuslan Ermilovformat.
370287d1861SRuslan Ermilov.It Cm state
371a54b88d8SChristian BruefferThe state is given by a sequence of characters, for example,
372287d1861SRuslan Ermilov.Dq Li RWNA .
373a54b88d8SChristian BruefferThe first character indicates the run state of the process:
3744b88c807SRodney W. Grimes.Pp
3754b88c807SRodney W. Grimes.Bl -tag -width indent -compact
376287d1861SRuslan Ermilov.It Li D
3774b88c807SRodney W. GrimesMarks a process in disk (or other short term, uninterruptible) wait.
378287d1861SRuslan Ermilov.It Li I
3794b88c807SRodney W. GrimesMarks a process that is idle (sleeping for longer than about 20 seconds).
380287d1861SRuslan Ermilov.It Li L
3810d632649SJohn BaldwinMarks a process that is waiting to acquire a lock.
382287d1861SRuslan Ermilov.It Li R
3834b88c807SRodney W. GrimesMarks a runnable process.
384287d1861SRuslan Ermilov.It Li S
3854b88c807SRodney W. GrimesMarks a process that is sleeping for less than about 20 seconds.
386287d1861SRuslan Ermilov.It Li T
3874b88c807SRodney W. GrimesMarks a stopped process.
388287d1861SRuslan Ermilov.It Li W
389bcf85d67SColin PercivalMarks an idle interrupt thread.
390287d1861SRuslan Ermilov.It Li Z
391287d1861SRuslan ErmilovMarks a dead process (a
392287d1861SRuslan Ermilov.Dq zombie ) .
3934b88c807SRodney W. Grimes.El
3944b88c807SRodney W. Grimes.Pp
3954b88c807SRodney W. GrimesAdditional characters after these, if any, indicate additional state
3964b88c807SRodney W. Grimesinformation:
3974b88c807SRodney W. Grimes.Pp
3984b88c807SRodney W. Grimes.Bl -tag -width indent -compact
399287d1861SRuslan Ermilov.It Li +
4004b88c807SRodney W. GrimesThe process is in the foreground process group of its control terminal.
401287d1861SRuslan Ermilov.It Li <
402287d1861SRuslan ErmilovThe process has raised CPU scheduling priority.
403287d1861SRuslan Ermilov.It Li E
4044b88c807SRodney W. GrimesThe process is trying to exit.
405287d1861SRuslan Ermilov.It Li J
406bcf85d67SColin PercivalMarks a process which is in
407bcf85d67SColin Percival.Xr jail 2 .
408bcf85d67SColin PercivalThe hostname of the prison can be found in
409287d1861SRuslan Ermilov.Pa /proc/ Ns Ao Ar pid Ac Ns Pa /status .
410287d1861SRuslan Ermilov.It Li L
4114b88c807SRodney W. GrimesThe process has pages locked in core (for example, for raw
4124b88c807SRodney W. Grimes.Tn I/O ) .
413287d1861SRuslan Ermilov.It Li N
414287d1861SRuslan ErmilovThe process has reduced CPU scheduling priority (see
4154b88c807SRodney W. Grimes.Xr setpriority 2 ) .
416287d1861SRuslan Ermilov.It Li s
4174b88c807SRodney W. GrimesThe process is a session leader.
418287d1861SRuslan Ermilov.It Li V
4194b88c807SRodney W. GrimesThe process is suspended during a
420c6e69125SPhilippe Charnier.Xr vfork 2 .
421287d1861SRuslan Ermilov.It Li W
4224b88c807SRodney W. GrimesThe process is swapped out.
423287d1861SRuslan Ermilov.It Li X
4244b88c807SRodney W. GrimesThe process is being traced or debugged.
4254b88c807SRodney W. Grimes.El
426287d1861SRuslan Ermilov.It Cm tt
4274b88c807SRodney W. GrimesAn abbreviation for the pathname of the controlling terminal, if any.
42877027e30SJoseph KoshyThe abbreviation consists of the three letters following
429c9a8d1f4SPhilippe Charnier.Pa /dev/tty ,
430287d1861SRuslan Ermilovor, for the console,
431287d1861SRuslan Ermilov.Dq Li con .
432287d1861SRuslan ErmilovThis is followed by a
433287d1861SRuslan Ermilov.Ql -
434287d1861SRuslan Ermilovif the process can no longer reach that
4354b88c807SRodney W. Grimescontrolling terminal (i.e., it has been revoked).
436287d1861SRuslan Ermilov.It Cm wchan
4374b88c807SRodney W. GrimesThe event (an address in the system) on which a process waits.
4384b88c807SRodney W. GrimesWhen printed numerically, the initial part of the address is
4394b88c807SRodney W. Grimestrimmed off and the result is printed in hex, for example, 0x80324000 prints
4404b88c807SRodney W. Grimesas 324000.
4414b88c807SRodney W. Grimes.El
4424b88c807SRodney W. Grimes.Pp
4434b88c807SRodney W. GrimesWhen printing using the command keyword, a process that has exited and
4444b88c807SRodney W. Grimeshas a parent that has not yet waited for the process (in other words, a zombie)
445287d1861SRuslan Ermilovis listed as
446287d1861SRuslan Ermilov.Dq Li <defunct> ,
447287d1861SRuslan Ermilovand a process which is blocked while trying
448287d1861SRuslan Ermilovto exit is listed as
449287d1861SRuslan Ermilov.Dq Li <exiting> .
4506aac4c27SXin LIIf the arguments cannot be located (usually because it has not been set, as is
4516aac4c27SXin LIthe case of system processes and/or kernel threads) the command name is printed
4526aac4c27SXin LIwithin square brackets.
453e004acc8SPhilippe CharnierThe
454e004acc8SPhilippe Charnier.Nm
4556aac4c27SXin LIutility first tries to obtain the arguments cached by the kernel (if they were
4566aac4c27SXin LIshorter than the value of the
4576aac4c27SXin LI.Va kern.ps_arg_cache_limit
4586aac4c27SXin LIsysctl).
4596aac4c27SXin LIThe process can change the arguments shown with
4606aac4c27SXin LI.Xr setproctitle 3 .
4616aac4c27SXin LIOtherwise,
4626aac4c27SXin LI.Nm
4634b88c807SRodney W. Grimesmakes an educated guess as to the file name and arguments given when the
4644b88c807SRodney W. Grimesprocess was created by examining memory or the swap area.
4654b88c807SRodney W. GrimesThe method is inherently somewhat unreliable and in any event a process
4666aac4c27SXin LIis entitled to destroy this information.
4674b88c807SRodney W. GrimesThe ucomm (accounting) keyword can, however, be depended on.
4686aac4c27SXin LIIf the arguments are unavailable or do not agree with the ucomm keyword,
4696aac4c27SXin LIthe value for the ucomm keyword is appended to the arguments in parentheses.
4704b88c807SRodney W. Grimes.Sh KEYWORDS
4714b88c807SRodney W. GrimesThe following is a complete list of the available keywords and their
4724b88c807SRodney W. Grimesmeanings.
4734b88c807SRodney W. GrimesSeveral of them have aliases (keywords which are synonyms).
4744b88c807SRodney W. Grimes.Pp
475287d1861SRuslan Ermilov.Bl -tag -width ".Cm sigignore" -compact
476287d1861SRuslan Ermilov.It Cm %cpu
477287d1861SRuslan Ermilovpercentage CPU usage (alias
478287d1861SRuslan Ermilov.Cm pcpu )
479287d1861SRuslan Ermilov.It Cm %mem
480287d1861SRuslan Ermilovpercentage memory usage (alias
481287d1861SRuslan Ermilov.Cm pmem )
482287d1861SRuslan Ermilov.It Cm acflag
483287d1861SRuslan Ermilovaccounting flag (alias
484287d1861SRuslan Ermilov.Cm acflg )
485287d1861SRuslan Ermilov.It Cm args
48603334017SJuli Mallettcommand and arguments
4877123f4cdSEdward Tomasz Napierala.It Cm class
4887123f4cdSEdward Tomasz Napieralalogin class
489287d1861SRuslan Ermilov.It Cm comm
49003334017SJuli Mallettcommand
491287d1861SRuslan Ermilov.It Cm command
49203334017SJuli Mallettcommand and arguments
493287d1861SRuslan Ermilov.It Cm cpu
494287d1861SRuslan Ermilovshort-term CPU usage factor (for scheduling)
495*b3178949SSergey Kandaurov.It Cm emul
496*b3178949SSergey Kandaurovsystem-call emulation environment
497287d1861SRuslan Ermilov.It Cm etime
49841ded75dSJuli Mallettelapsed running time, format
49941ded75dSJuli Mallett.Op days- Ns
50041ded75dSJuli Mallett.Op hours: Ns
50141ded75dSJuli Mallettminutes:seconds.
50241ded75dSJuli Mallett.It Cm etimes
50341ded75dSJuli Mallettelapsed running time, in decimal integer seconds
504287d1861SRuslan Ermilov.It Cm flags
505287d1861SRuslan Ermilovthe process flags, in hexadecimal (alias
506287d1861SRuslan Ermilov.Cm f )
5079acd9127SEdward Tomasz Napierala.It Cm gid
5089acd9127SEdward Tomasz Napieralaeffective group ID (alias
5099acd9127SEdward Tomasz Napierala.Cm egid )
5109acd9127SEdward Tomasz Napierala.It Cm group
5119acd9127SEdward Tomasz Napieralagroup name (from egid) (alias
5129acd9127SEdward Tomasz Napierala.Cm egroup )
513287d1861SRuslan Ermilov.It Cm inblk
514287d1861SRuslan Ermilovtotal blocks read (alias
515287d1861SRuslan Ermilov.Cm inblock )
516a990344fSPawel Jakub Dawidek.It Cm jid
517a990344fSPawel Jakub Dawidekjail ID
518287d1861SRuslan Ermilov.It Cm jobc
5194b88c807SRodney W. Grimesjob control count
520287d1861SRuslan Ermilov.It Cm ktrace
5214b88c807SRodney W. Grimestracing flags
522287d1861SRuslan Ermilov.It Cm label
5232af538ebSRobert WatsonMAC label
524287d1861SRuslan Ermilov.It Cm lim
5254b88c807SRodney W. Grimesmemoryuse limit
5266aac4c27SXin LI.It Cm lockname
5276aac4c27SXin LIlock currently blocked on (as a symbolic name)
528287d1861SRuslan Ermilov.It Cm logname
5296aac4c27SXin LIlogin name of user who started the session
530287d1861SRuslan Ermilov.It Cm lstart
5314b88c807SRodney W. Grimestime started
532*b3178949SSergey Kandaurov.It Cm lwp
533*b3178949SSergey Kandaurovprocess thread-id
534287d1861SRuslan Ermilov.It Cm majflt
5354b88c807SRodney W. Grimestotal page faults
536287d1861SRuslan Ermilov.It Cm minflt
5374b88c807SRodney W. Grimestotal page reclaims
538287d1861SRuslan Ermilov.It Cm msgrcv
5394b88c807SRodney W. Grimestotal messages received (reads from pipes/sockets)
540287d1861SRuslan Ermilov.It Cm msgsnd
5414b88c807SRodney W. Grimestotal messages sent (writes on pipes/sockets)
542287d1861SRuslan Ermilov.It Cm mwchan
5430d632649SJohn Baldwinwait channel or lock currently blocked on
544287d1861SRuslan Ermilov.It Cm nice
545287d1861SRuslan Ermilovnice value (alias
546287d1861SRuslan Ermilov.Cm ni )
547287d1861SRuslan Ermilov.It Cm nivcsw
5484b88c807SRodney W. Grimestotal involuntary context switches
549*b3178949SSergey Kandaurov.It Cm nlwp
550*b3178949SSergey Kandaurovnumber of threads tied to a process
551287d1861SRuslan Ermilov.It Cm nsigs
552287d1861SRuslan Ermilovtotal signals taken (alias
553287d1861SRuslan Ermilov.Cm nsignals )
554287d1861SRuslan Ermilov.It Cm nswap
5554b88c807SRodney W. Grimestotal swaps in/out
556287d1861SRuslan Ermilov.It Cm nvcsw
5574b88c807SRodney W. Grimestotal voluntary context switches
558287d1861SRuslan Ermilov.It Cm nwchan
5594b88c807SRodney W. Grimeswait channel (as an address)
560287d1861SRuslan Ermilov.It Cm oublk
561287d1861SRuslan Ermilovtotal blocks written (alias
562287d1861SRuslan Ermilov.Cm oublock )
563287d1861SRuslan Ermilov.It Cm paddr
5640d694829SSergey Kandaurovprocess pointer
565287d1861SRuslan Ermilov.It Cm pagein
5664b88c807SRodney W. Grimespageins (same as majflt)
567287d1861SRuslan Ermilov.It Cm pgid
5684b88c807SRodney W. Grimesprocess group number
569287d1861SRuslan Ermilov.It Cm pid
570287d1861SRuslan Ermilovprocess ID
571287d1861SRuslan Ermilov.It Cm ppid
572287d1861SRuslan Ermilovparent process ID
573287d1861SRuslan Ermilov.It Cm pri
5744b88c807SRodney W. Grimesscheduling priority
575287d1861SRuslan Ermilov.It Cm re
5764b88c807SRodney W. Grimescore residency time (in seconds; 127 = infinity)
577287d1861SRuslan Ermilov.It Cm rgid
578287d1861SRuslan Ermilovreal group ID
579287d1861SRuslan Ermilov.It Cm rgroup
580e8eef4bbSJuli Mallettgroup name (from rgid)
581287d1861SRuslan Ermilov.It Cm rss
5824b88c807SRodney W. Grimesresident set size
583287d1861SRuslan Ermilov.It Cm rtprio
584a837235aSDavid Greenmanrealtime priority (101 = not a realtime process)
585287d1861SRuslan Ermilov.It Cm ruid
586287d1861SRuslan Ermilovreal user ID
587287d1861SRuslan Ermilov.It Cm ruser
5884b88c807SRodney W. Grimesuser name (from ruid)
589287d1861SRuslan Ermilov.It Cm sid
590287d1861SRuslan Ermilovsession ID
591287d1861SRuslan Ermilov.It Cm sig
592287d1861SRuslan Ermilovpending signals (alias
593287d1861SRuslan Ermilov.Cm pending )
594287d1861SRuslan Ermilov.It Cm sigcatch
595287d1861SRuslan Ermilovcaught signals (alias
596287d1861SRuslan Ermilov.Cm caught )
597287d1861SRuslan Ermilov.It Cm sigignore
598287d1861SRuslan Ermilovignored signals (alias
599287d1861SRuslan Ermilov.Cm ignored )
600287d1861SRuslan Ermilov.It Cm sigmask
601287d1861SRuslan Ermilovblocked signals (alias
602287d1861SRuslan Ermilov.Cm blocked )
603287d1861SRuslan Ermilov.It Cm sl
6044b88c807SRodney W. Grimessleep time (in seconds; 127 = infinity)
605287d1861SRuslan Ermilov.It Cm start
6064b88c807SRodney W. Grimestime started
607287d1861SRuslan Ermilov.It Cm state
608287d1861SRuslan Ermilovsymbolic process state (alias
609287d1861SRuslan Ermilov.Cm stat )
610287d1861SRuslan Ermilov.It Cm svgid
6114b88c807SRodney W. Grimessaved gid from a setgid executable
612287d1861SRuslan Ermilov.It Cm svuid
613287d1861SRuslan Ermilovsaved UID from a setuid executable
614a870bf2cSKonstantin Belousov.It Cm systime
615a870bf2cSKonstantin Belousovaccumulated system CPU time
6166239ef1dSEd Maste.It Cm tdaddr
6176239ef1dSEd Mastethread address
618287d1861SRuslan Ermilov.It Cm tdev
6194b88c807SRodney W. Grimescontrol terminal device number
620287d1861SRuslan Ermilov.It Cm time
621287d1861SRuslan Ermilovaccumulated CPU time, user + system (alias
622287d1861SRuslan Ermilov.Cm cputime )
623287d1861SRuslan Ermilov.It Cm tpgid
624287d1861SRuslan Ermilovcontrol terminal process group ID
625287d1861SRuslan Ermilov.\".It Cm trss
6264b88c807SRodney W. Grimes.\"text resident set size (in Kbytes)
627287d1861SRuslan Ermilov.It Cm tsid
628287d1861SRuslan Ermilovcontrol terminal session ID
629287d1861SRuslan Ermilov.It Cm tsiz
6304b88c807SRodney W. Grimestext size (in Kbytes)
631287d1861SRuslan Ermilov.It Cm tt
6324b88c807SRodney W. Grimescontrol terminal name (two letter abbreviation)
633287d1861SRuslan Ermilov.It Cm tty
6344b88c807SRodney W. Grimesfull name of control terminal
635287d1861SRuslan Ermilov.It Cm ucomm
6364b88c807SRodney W. Grimesname to be used for accounting
637287d1861SRuslan Ermilov.It Cm uid
6389acd9127SEdward Tomasz Napieralaeffective user ID (alias
6399acd9127SEdward Tomasz Napierala.Cm euid )
640287d1861SRuslan Ermilov.It Cm upr
641287d1861SRuslan Ermilovscheduling priority on return from system call (alias
642287d1861SRuslan Ermilov.Cm usrpri )
643*b3178949SSergey Kandaurov.It Cm uprocp
644*b3178949SSergey Kandaurovprocess pointer
645287d1861SRuslan Ermilov.It Cm user
646287d1861SRuslan Ermilovuser name (from UID)
647a870bf2cSKonstantin Belousov.It Cm usertime
648a870bf2cSKonstantin Belousovaccumulated user CPU time
649287d1861SRuslan Ermilov.It Cm vsz
650287d1861SRuslan Ermilovvirtual size in Kbytes (alias
651287d1861SRuslan Ermilov.Cm vsize )
652287d1861SRuslan Ermilov.It Cm wchan
6534b88c807SRodney W. Grimeswait channel (as a symbolic name)
654287d1861SRuslan Ermilov.It Cm xstat
6554b88c807SRodney W. Grimesexit or stop status (valid only for stopped or zombie process)
6564b88c807SRodney W. Grimes.El
6577117b3d5SKonstantin Belousov.Pp
6587117b3d5SKonstantin BelousovNote that the
6597117b3d5SKonstantin Belousov.Cm pending
6607117b3d5SKonstantin Belousovcolumn displays bitmask of signals pending in the process queue when
6617117b3d5SKonstantin Belousov.Fl H
6627117b3d5SKonstantin Belousovoption is not specified, otherwise the per-thread queue of pending signals
6637117b3d5SKonstantin Belousovis shown.
6644f18100dSTim J. Robbins.Sh ENVIRONMENT
6654f18100dSTim J. RobbinsThe following environment variables affect the execution of
6664f18100dSTim J. Robbins.Nm :
6674f18100dSTim J. Robbins.Bl -tag -width ".Ev COLUMNS"
6684f18100dSTim J. Robbins.It Ev COLUMNS
6694f18100dSTim J. RobbinsIf set, specifies the user's preferred output width in column positions.
6704f18100dSTim J. RobbinsBy default,
6714f18100dSTim J. Robbins.Nm
6724f18100dSTim J. Robbinsattempts to automatically determine the terminal width.
6734f18100dSTim J. Robbins.El
6744b88c807SRodney W. Grimes.Sh FILES
675cd31922fSRuslan Ermilov.Bl -tag -width ".Pa /boot/kernel/kernel" -compact
6761063e126SJosef Karthauser.It Pa /boot/kernel/kernel
6774b88c807SRodney W. Grimesdefault system namelist
6781c0c7731SJoerg Wunsch.It Pa /proc
6791c0c7731SJoerg Wunschthe mount point of
6801c0c7731SJoerg Wunsch.Xr procfs 5
6814b88c807SRodney W. Grimes.El
6824b88c807SRodney W. Grimes.Sh SEE ALSO
6834b88c807SRodney W. Grimes.Xr kill 1 ,
684585bf557SGarance A Drosehn.Xr pgrep 1 ,
685585bf557SGarance A Drosehn.Xr pkill 1 ,
686e5002279SEdward Tomasz Napierala.Xr procstat 1 ,
6874b88c807SRodney W. Grimes.Xr w 1 ,
6884b88c807SRodney W. Grimes.Xr kvm 3 ,
6894b88c807SRodney W. Grimes.Xr strftime 3 ,
690ac06cb0aSRobert Watson.Xr mac 4 ,
691b5f82180SRuslan Ermilov.Xr procfs 5 ,
6929b67ac59SJohn Baldwin.Xr pstat 8 ,
6936b821228SDima Dorfman.Xr sysctl 8 ,
6949b67ac59SJohn Baldwin.Xr mutex 9
695a4c8a745SGarance A Drosehn.Sh STANDARDS
6966aac4c27SXin LIFor historical reasons, the
697a4c8a745SGarance A Drosehn.Nm
698a4c8a745SGarance A Drosehnutility under
699a4c8a745SGarance A Drosehn.Fx
700a4c8a745SGarance A Drosehnsupports a different set of options from what is described by
701a4c8a745SGarance A Drosehn.St -p1003.2 ,
702287d1861SRuslan Ermilovand what is supported on
703287d1861SRuslan Ermilov.No non- Ns Bx
704287d1861SRuslan Ermilovoperating systems.
705a13d4e42SJuli Mallett.Sh HISTORY
706a13d4e42SJuli MallettThe
707a13d4e42SJuli Mallett.Nm
708a13d4e42SJuli Mallettcommand appeared in
7097140a0e9SJuli Mallett.At v4 .
7104b88c807SRodney W. Grimes.Sh BUGS
7114b88c807SRodney W. GrimesSince
712c9a8d1f4SPhilippe Charnier.Nm
7134b88c807SRodney W. Grimescannot run faster than the system and is run as any other scheduled
7144b88c807SRodney W. Grimesprocess, the information it displays can never be exact.
715b59ca660STim J. Robbins.Pp
716b59ca660STim J. RobbinsThe
717b59ca660STim J. Robbins.Nm
718b59ca660STim J. Robbinsutility does not correctly display argument lists containing multibyte
719b59ca660STim J. Robbinscharacters.
720