delete "rusage" alias; delete -s option; change "trs" to "trss"
[unix-history] / usr / src / bin / ps / ps.1
CommitLineData
dd9e2e8d 1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
b5dc1377
CL
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
0f5eb034 6.\" @(#)ps.1 6.13 (Berkeley) %G%
b5dc1377 7.\"
b5bb6e20
MT
8.TH PS 1 "March 10, 1988"
9.UC 4
10.SH NAME
11ps \- process status
12.SH SYNOPSIS
fd57c467
KB
13.nf
14.ft B
0f5eb034 15ps [ \-aChjlmrSTuvwx ] [ \-O|o fmt ] [ \-p pid ] [ \-t tty \] [ system ] [ core ] [ swap ]
fd57c467
KB
16ps [ \-L ]
17.ft R
18.fi
b5bb6e20 19.SH DESCRIPTION
fd57c467
KB
20.I Ps
21displays a header line followed by lines containing information about your
22processes that have controlling terminals.
23This information is sorted by process ID.
b5bb6e20 24.PP
fd57c467
KB
25The information displayed is selected based on a set of keywords (see the
26\-L, \-O and \-o options).
27The default output format includes, for each process, the process' ID,
28controlling terminal, cpu time (including both user and system time),
29state, and associated command.
b5bb6e20 30.PP
fd57c467 31The options are as follows:
b5bb6e20 32.TP
fd57c467
KB
33\-a
34Display information about other users' processes as well as your own.
b5bb6e20 35.TP
fd57c467
KB
36\-C
37Change the way the cpu percentage is calculated by using a ``raw''
38cpu calculation that ignores ``resident'' time (this normally has
39no effect).
b5bb6e20 40.TP
fd57c467
KB
41\-h
42Repeat the information header as often as necessary to guarantee one
43header per page of information.
b5bb6e20 44.TP
fd57c467
KB
45\-j
46Print information associated with the following keywords:
34fd22d9 47user, pid, ppid, pgid, sess, jobc, state, tt, time and command.
b5bb6e20 48.TP
fd57c467
KB
49\-L
50List the set of available keywords.
51If the \-L option is specified more than once,
52.I ps
53will display a long listing of the keywords and their meanings.
b5bb6e20 54.TP
fd57c467
KB
55\-l
56Display information associated with the following keywords:
34fd22d9
KB
57uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time
58and command.
fd57c467
KB
59.TP
60\-m
61Sort by memory usage, instead of by process ID.
62.TP
63\-O
64Add the information associated with the space or comma separated list
65of keywords specifed, after the process ID, in the default information
66display.
67Keywords may be appended with an equals (``='') sign and a string.
68This causes the printed header to use the specified string instead of
69the standard header.
70.TP
71\-o
72Display information associated with the space or comma separated list
73of keywords specifed.
74Keywords may be appended with an equals (``='') sign and a string.
75This causes the printed header to use the specified string instead of
76the standard header.
77.TP
78\-p
79Display information associated with the specified process ID.
80.TP
81\-r
82Sort by current cpu usage, instead of by process ID.
83.TP
84\-S
85Change the way the process time is calculated by summing all exited
86children to their parent process.
87.TP
fd57c467
KB
88\-T
89Display information about processes attached to the device associated
90with the standard input.
91.TP
92\-t
93Display information about processes attached to the specified terminal
94device.
95.TP
96\-u
97Display information associated with the following keywords:
34fd22d9 98user, pid, %cpu, %mem, vsz, rss, tt, state, start, time and command.
fd57c467
KB
99The \-u option implies the \-r option.
100.TP
101\-v
102Display information associated with the following keywords:
0f5eb034 103pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, trss,
34fd22d9 104%cpu, %mem and command.
fd57c467
KB
105The \-v option implies the \-m option.
106.TP
107\-w
108Use 132 columns to display information, instead of the default which
109is your window size.
110If the \-w option is specified more than once,
b5bb6e20 111.I ps
fd57c467
KB
112will use as many columns as necessary without regard for your window size.
113.TP
114\-x
115Display information about processes without controlling terminals.
116.PP
117Three additional arguments may be specified.
118The first additional argument is the file to read for the system namelist
119(instead of the default ``/vmunix'').
120The second additional argument is a core file to use for kernel memory
121(instead of the default ``/dev/mem'').
122The third addition argument is a file to be used for swap
123(instead of the default ``/dev/swap'').
b5bb6e20 124.PP
fd57c467
KB
125A complete list of the available keywords are listed below.
126Some of these keywords are further specifed as follows:
b5bb6e20 127.TP
e3a8e66d
KB
128%cpu
129The cpu utilization of the process; this is a decaying average over up to
130a minute of previous (real) time.
131Since the time base over which this is computed varies (since processes may
132be very young) it is possible for the sum of all %CPU fields to exceed 100%.
133.TP
134%mem
135The percentage of real memory used by this process.
136.TP
fd57c467
KB
137flags
138The flags (in hexadecimal) associated with the process as in
139the include file ``sys/proc.h'':
140.sp
141.nf
142.RS
143.ta \w'SNOCLDSTOP 'u +\w'0040000 'u
144SLOAD 0000001 in core
145SSYS 0000002 swapper or pager process
146SLOCK 0000004 process being swapped out
147SSWAP 0000008 save area flag
148STRC 0000010 process is being traced
149SWTED 0000020 another tracing flag
150SSINTR 0000040 sleep is interruptible
151SPAGE 0000080 process in page wait state
152SKEEP 0000100 another flag to prevent swap out
153SOMASK 0000200 restore old mask after taking signal
154SWEXIT 0000400 working on exiting
155SPHYSIO 0000800 doing physical i/o
156SVFORK 0001000 process resulted from vfork()
157SVFDONE 0002000 another vfork flag
158SNOVM 0004000 no vm, parent in a vfork()
159SPAGV 0008000 init data space on demand, from vnode
160SSEQL 0010000 user warned of sequential vm behavior
161SUANOM 0020000 user warned of random vm behavior
162STIMO 0040000 timing out during sleep
163SNOCLDSTOP 0080000 no SIGCHLD when children stop
164SCTTY 0100000 has a controlling terminal
165SOWEUPC 0200000 owe process an addupc() call at next ast
166SSEL 0400000 selecting; wakeup/waiting danger
167SEXEC 0800000 process called exec
168SHPUX 1000000 HP-UX process (HPUXCOMPAT)
169SULOCK 2000000 locked in core after swap error
170SPTECHG 4000000 pte's for process have changed
171.fi
172.RE
173.TP
174lim
175The soft limit on memory used, specified via a call to
176.IR setrlimit (2).
177.TP
178lstart
e3a8e66d 179The exact time the command started, using the ``%C'' format described in
fd57c467
KB
180.IR strftime (3).
181.TP
182nice
183The process scheduling increment (see
184.IR setpriority (2)).
185.TP
fd57c467
KB
186rss
187the real memory (resident set) size of the process (in 1024 byte units).
188.TP
189start
190The time the command started.
191If the command started less than 24 hours ago, the start time is
192displayed using the ``%l:ps.1p'' format described in
193.IR strftime (3).
194If the command started less than 7 days ago, the start time is
0f5eb034 195displayed using the ``%a6.13p'' format.
fd57c467 196Otherwise, the start time is displayed using the ``%e%b%y'' format.
b5bb6e20
MT
197.TP
198state
199The state is given by a sequence of letters, e.g., ``RWNA''.
200The first letter indicates the run state of the process:
fd57c467 201.sp
b5bb6e20
MT
202.PD 0
203.RS
b5bb6e20 204.IP D
fd57c467 205Marks a process in disk (or other short term, uninterruptable) wait.
b5bb6e20 206.IP I
fd57c467
KB
207Marks a process that is idle (sleeping for longer than about 20 seconds).
208.IP P
209Marks a process in page wait.
210.IP R
211Marks a runnable process.
212.IP S
213Marks a process that is sleeping for less than about 20 seconds.
214.IP T
215Marks a stopped process.
b5bb6e20 216.IP Z
fd57c467
KB
217Marks a dead process (a ``zombie'').
218.sp
219.PP
220Additional characters after these, if any, indicate additional state
221information:
222.sp
223.IP +
224The process is in the foreground process group of its control terminal.
b5bb6e20 225.IP <
fd57c467
KB
226The process has raised CPU scheduling priority.
227.IP >
228The process has specified a soft limit on memory requirements and is
229currently exceeding that limit; such a process is (necessarily) not
230swapped.
b5bb6e20 231.IP A
fd57c467 232the process has asked for random page replacement (VA_ANOM, from
b5bb6e20
MT
233.IR vadvise (2),
234e.g.,
235.IR lisp (1)
fd57c467 236in a garbage collect).
b5bb6e20 237.IP E
fd57c467 238The process is trying to exit.
b5bb6e20 239.IP L
fd57c467
KB
240The process has pages locked in core (e.g., for raw I/O).
241.IP N
242The process has reduced CPU scheduling priority (see
243.IR setpriority (2)).
244.IP S
245The process has asked for FIFO page replacement (VA_SEQL, from
246.IR vadvise (2),
247e.g., a large image processing program using virtual memory to
248sequentially address voluminous data).
b5bb6e20 249.IP s
fd57c467
KB
250The process is a session leader.
251.IP V
252The process is suspended during a vfork.
253.IP W
254The process is swapped out.
255.IP X
256The process is being traced or debugged.
b5bb6e20
MT
257.RE
258.PD
259.TP
e3a8e66d 260tt
fd57c467
KB
261An abbreviation for the pathname of the controlling terminal, if any.
262The abbreviation consists of the two letters following ``/dev/tty'',
263or, for the console, ``co''.
264This is followed by a ``-'' if the process can no longer reach that
265controlling terminal (i.e., it has been revoked).
b5bb6e20
MT
266.TP
267wchan
fd57c467 268The event on which the process is waiting (an address in the system).
b5bb6e20 269When printed numerically, the initial part of the address is
fd57c467
KB
270trimmed off and the result is printed in hex, e.g., 0x80324000 prints
271as 324000.
b5bb6e20 272.PP
e3a8e66d
KB
273When printing using the command keyword, a process that has exited and
274has a parent that has not yet waited for the process (i.e., a zombie)
275is listed as ``<defunct>'', and a process which is blocked while trying
276to exit is listed as ``<exiting>''.
b5bb6e20 277.B Ps
fd57c467
KB
278makes an educated guess as to the file name and arguments given when the
279process was created by examining memory or the swap area.
280The method is inherently somewhat unreliable and in any event a process
281is entitled to destroy this information, so the names cannot be depended
282on too much.
e3a8e66d 283The ucomm (accounting) keyword can, however, be depended on.
fd57c467 284.SH "KEYWORDS"
e3a8e66d
KB
285The following is a complete list of the available keywords and their
286meanings.
287Several of them have aliases, i.e. keywords that are synonyms.
288.sp
b5bb6e20 289.PD 0
e3a8e66d
KB
290.IP %cpu 10
291percentage cpu usage (alias pcpu)
292.IP %mem 10
293percentage memory usage (alias pmem)
294.IP acflag 10
295accounting flag (alias acflg)
b5bb6e20
MT
296.IP command 10
297command and arguments
fd57c467
KB
298.IP cpu 10
299short-term cpu usage factor (for scheduling)
e3a8e66d
KB
300.IP flags 10
301the process flags, in hexadecimal (alias f)
302.IP inblk 10
303total blocks read (alias inblock)
fd57c467
KB
304.IP jobc 10
305job control count
306.IP ktrace 10
307tracing flags
308.IP ktracep 10
309tracing vnode
310.IP lim 10
311memoryuse limit
312.IP logname 10
313login name of user who started the process
fd57c467
KB
314.IP lstart 10
315time started
316.IP majflt 10
317total page faults
318.IP minflt 10
319total page reclaims
320.IP msgrcv 10
321total messages received (reads from pipes/sockets)
322.IP msgsnd 10
323total messages sent (writes on pipes/sockets)
324.IP nice 10
e3a8e66d 325nice value (alias ni)
fd57c467
KB
326.IP nivcsw 10
327total involuntary context switches
e3a8e66d
KB
328.IP nsigs 10
329total signals taken (alias nsignals)
fd57c467
KB
330.IP nswap 10
331total swaps in/out
332.IP nvcsw 10
333total voluntary context switches
334.IP nwchan 10
e3a8e66d
KB
335wait channel (as an address)
336.IP oublk 10
337total blocks written (alias oublock)
fd57c467
KB
338.IP p_ru 10
339resource usage (valid only for zombie)
340.IP paddr 10
341swap address
342.IP pagein 10
343pageins (same as majflt)
fd57c467
KB
344.IP pgid 10
345process group number
b5bb6e20
MT
346.IP pid 10
347process ID
b5bb6e20
MT
348.IP poip 10
349pageouts in progress
fd57c467
KB
350.IP ppid 10
351parent process ID
352.IP pri 10
353scheduling priority
354.IP re 10
355core residency time (in seconds; 127 = infinity)
356.IP rgid 10
357real group ID
b5bb6e20
MT
358.IP rlink 10
359reverse link on run queue, or 0
fd57c467
KB
360.IP rss 10
361resident set size
e3a8e66d
KB
362.IP rsz 10
363resident set size + (text size / text use count) (alias rssize)
fd57c467
KB
364.IP ruid 10
365real user ID
b5bb6e20
MT
366.IP ruser 10
367user name (from ruid)
b5bb6e20
MT
368.IP sess 10
369session pointer
fd57c467 370.IP sig 10
e3a8e66d 371pending signals (alias pending)
fd57c467 372.IP sigcatch 10
e3a8e66d 373caught signals (alias caught)
fd57c467 374.IP sigignore 10
e3a8e66d 375ignored signals (alias ignored)
fd57c467 376.IP sigmask 10
e3a8e66d 377blocked signals (alias blocked)
fd57c467
KB
378.IP sl 10
379sleep time (in seconds; 127 = infinity)
380.IP start 10
381time started
382.IP state 10
e3a8e66d 383symbolic process state (alias stat)
fd57c467
KB
384.IP svgid 10
385saved gid from a setgid executable
386.IP svuid 10
387saved uid from a setuid executable
b5bb6e20
MT
388.IP tdev 10
389control terminal device number
e3a8e66d
KB
390.IP time 10
391accumulated cpu time, user + system (alias cputime)
b5bb6e20
MT
392.IP tpgid 10
393control terminal process group ID
0f5eb034 394.IP trss 10
fd57c467 395text resident set size (in Kbytes)
e3a8e66d 396.IP tsess 10
b5bb6e20 397control terminal session pointer
fd57c467
KB
398.IP tsiz 10
399text size (in Kbytes)
e3a8e66d
KB
400.IP tt 10
401control terminal name (two letter abbreviation)
402.IP tty 10
403full name of control terminal
404.IP uprocp 10
fd57c467
KB
405process pointer
406.IP ucomm 10
407name to be used for accounting
408.IP uid 10
409effective user ID
e3a8e66d
KB
410.IP upr 10
411scheduling priority on return from system call (alias usrpri)
fd57c467
KB
412.IP user 10
413user name (from uid)
e3a8e66d
KB
414.IP vsz 10
415virtual size in Kbytes (alias vsize)
fd57c467 416.IP wchan 10
e3a8e66d 417wait channel (as a symbolic name)
fd57c467
KB
418.IP xstat 10
419exit or stop status (valid only for stopped or zombie process)
b5bb6e20
MT
420.PD
421.SH FILES
fd57c467
KB
422.ta \w'/var/run/kvm_vmunix.db 'u
423/dev special files and device names
424.br
425/dev/drum default swap device
b5bb6e20 426.br
fd57c467 427/dev/kmem default kernel memory
b5bb6e20 428.br
fd57c467 429/var/run/dev.db /dev name database
b5bb6e20 430.br
fd57c467 431/var/run/kvm_vmunix.db system namelist database
b5bb6e20 432.br
fd57c467 433/vmunix default system namelist
b5bb6e20 434.SH "SEE ALSO"
fd57c467 435kill(1), w(1), kvm(3), strftime(3), pstat(8)
b5bb6e20
MT
436.SH BUGS
437Things can change while
438.I ps
fd57c467 439is running; the picture it gives is only a fairly close
b5bb6e20 440approximation to reality.