"pagedaemon" is too long now
[unix-history] / usr / src / bin / ps / ps.1
CommitLineData
24115aa8
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
d6cf0c8b 5.\" @(#)ps.1 6.5 (Berkeley) %G%
24115aa8 6.\"
9a22b5c6 7.TH PS 1 ""
24115aa8
KM
8.UC 4
9.SH NAME
10ps \- process status
11.SH SYNOPSIS
12.B ps
13[
53829504 14.B acegklnstuvwxU#
24115aa8
KM
15]
16.SH DESCRIPTION
17.I Ps
18prints information about processes.
19Normally, only your processes are candidates to be printed by
20.I ps;
21specifying
22.B a
c3f41f75 23causes other users' processes to be candidates to be printed;
24115aa8
KM
24specifying
25.B x
26includes processes without control terminals in the candidate pool.
27.PP
28All output formats include, for each process, the process id PID,
29control terminal of the process TT, cpu time used by the process TIME
30(this includes both user and system time), the state STAT of the process,
31and an indication of the COMMAND which is running.
d6cf0c8b 32The state is given by a sequence of letters, e.g. ``RWNA''.
24115aa8
KM
33The first letter indicates the runnability of the process:
34R for runnable processes,
35T for stopped processes,
36P for processes in page wait,
37D for those in disk (or other short term) waits,
38S for those sleeping for less than about 20 seconds,
39and I for idle (sleeping longer than about 20 seconds)
40processes.
d6cf0c8b
MK
41Additional characters after these, if any,
42indicate additional state information.
43The letter W indicates that a process is swapped out,
44showing W if it is, or a blank if it is loaded (in-core).
45A process which has specified a soft limit on memory requirements
24115aa8
KM
46and which is exceeding that limit shows >; such a process is (necessarily)
47not swapped.
d6cf0c8b 48An additional letter may indicate whether a process is running with altered
dee48434
KM
49CPU scheduling priority (nice); if the process priority is reduced,
50an N is shown, if the process priority has been artificially raised then
d6cf0c8b
MK
51a `<' is shown.
52The final optional letter
53indicates any special treatment of the process for virtual
24115aa8
KM
54memory replacement; the letters correspond to options to the
55.IR vadvise (2)
d6cf0c8b
MK
56call; currently the possibilities are A standing for VA_ANOM and
57S for VA_SEQL.
58An A typically represents a
24115aa8 59.IR lisp (1)
d6cf0c8b 60in garbage collection, and S is typical of large image processing programs
24115aa8
KM
61which are using virtual memory to sequentially address voluminous data.
62.PP
63Here are the options:
64.TP 5
65.B a
66asks for information about all processes with terminals (ordinarily
67only one's own processes are displayed).
68.TP 5
69.B c
70prints the command name, as stored internally in the system for purposes
71of accounting, rather than the command arguments, which are kept
72in the process' address space. This is more reliable, if less informative,
73since the process is free to destroy the latter information.
74.TP 5
75.B e
76Asks for the environment to be printed as well as the arguments to the command.
77.TP 5
78.B g
79Asks for all processes.
80Without this option,
81.I ps
82only prints ``interesting'' processes.
83Processes are deemed to be uninteresting if they are process group leaders.
84This normally eliminates top-level command interpreters and processes
85waiting for users to login on free terminals.
86.TP 5
87.B k
88causes the file
89.I /vmcore
90is used in place of
91.IR /dev/kmem " and " /dev/mem.
92This is used for
93postmortem system debugging.
94.TP 5
95.B l
96asks for a long listing, with fields PPID, CP, PRI, NI, ADDR, SIZE, RSS and
97WCHAN as described below.
98.TP 5
53829504
KM
99.B n
100Asks for numerical output.
101In a long listing, the WCHAN field is printed numerically rather than
102symbolically, or, in a user listing, the USER field is replaced by a
103UID field.
104.TP 5
24115aa8
KM
105.B s
106Adds the size SSIZ of the kernel stack of each process (for use by system
107maintainers) to the basic output format.
108.TP 5
109\fBt\fIx\fR
110restricts output to processes whose controlling tty is \fIx\fR
111(which should be specified as printed by
112.I ps,
113e.g.
114.I t3
115for tty3,
116.I tco
117for console,
118.I td0
119for ttyd0,
120.I t?
121for processes with no tty,
dee48434
KM
122.I t
123for processes at the current tty,
24115aa8
KM
124etc).
125This option must be the last one given.
126.TP 5
127.B u
128A user oriented output is produced.
129This includes fields USER, %CPU, NICE, SIZE, and RSS as described below.
130.TP 5
131.B v
132A version of the output containing virtual memory statistics is output.
133This includes fields RE, SL, PAGEIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU
134and %MEM, described below.
135.TP 5
136.B w
137Use a wide output format (132 columns rather than 80); if repeated,
138e.g. ww, use arbitrarily wide output.
139This information is used to decide how much of long commands to print.
140.TP 5
141.B x
142asks even about processes with no terminal.
9a22b5c6
KM
143.TP
144.B U
3e284fd6 145causes ps to update a private database where it keeps system
9a22b5c6 146information. Thus ``ps U'' should be included in the /etc/rc file.
24115aa8
KM
147.TP 5
148.B #
149A process number may be given,
150(indicated here by #),
151in which case the output
152is restricted to that process.
153This option must also be last.
154.PP
dee48434
KM
155A second argument is taken
156to be the file containing the system's
157namelist. Otherwise, /vmunix is used.
158A third argument tells
24115aa8
KM
159.I ps
160where to look for
161.I core
162if the
163.B k
164option is given, instead of /vmcore.
dee48434
KM
165If a fourth argument is given, it
166is taken to be the name of a swap file to use instead of
24115aa8 167the default /dev/drum.
24115aa8
KM
168.PP
169Fields which are not common to all output formats:
170.PD 0
171.IP USER 10
172name of the owner of the process
173.IP %CPU 10
174cpu utilization of the process; this is a decaying average over up to
175a minute of previous (real) time. Since the time base over which this
176is computed varies (since processes may be very young) it is possible
177for the sum of all %CPU fields to exceed 100%.
178.IP NICE 10
179(or NI) process scheduling increment (see
dee48434 180.IR setpriority (2))
24115aa8
KM
181.IP SIZE 10
182virtual size of the process (in 1024 byte units)
183.IP RSS 10
184real memory (resident set) size of the process (in 1024 byte units)
185.IP LIM 10
186soft limit on memory used, specified via a call to
dee48434 187.IR setrlimit (2);
24115aa8
KM
188if no limit has been specified then shown as \fIxx\fR
189.IP TSIZ 10
190size of text (shared program) image
191.IP TRS 10
192size of resident (real memory) set of text
193.IP %MEM 10
194percentage of real memory used by this process.
195.IP RE 10
196residency time of the process (seconds in core)
197.IP SL 10
198sleep time of the process (seconds blocked)
199.IP PAGEIN 10
200number of disk i/o's resulting from references by the process
201to pages not loaded in core.
202.IP UID 10
203numerical user-id of process owner
204.IP PPID 10
205numerical id of parent of process
206.IP CP 10
207short-term cpu utilization factor (used in scheduling)
208.IP PRI 10
209process priority (non-positive when in non-interruptible wait)
210.IP ADDR 10
211swap address of the process
212.IP WCHAN 10
53829504
KM
213event on which process is waiting (an address in the system).
214A symbol is chosen that classifies the address, unless numerical
215output is requested (see the
216.B n
217flag).
218In this case, the initial part of the address is
219trimmed off and is printed hexadecimally, e.g., 0x80004000 prints as 4000.
24115aa8
KM
220.sp
221.IP F 10
dee48434
KM
222flags associated with process as in
223.RI < sys/proc.h >:
24115aa8
KM
224.br
225.PP
226.sp
227.nf
228.ta 6n 18n 26n
229 SLOAD 000001 in core
230 SSYS 000002 swapper or pager process
231 SLOCK 000004 process being swapped out
232 SSWAP 000008 save area flag
233 STRC 000010 process is being traced
234 SWTED 000020 another tracing flag
235 SULOCK 000040 user settable lock in core
236 SPAGE 000080 process in page wait state
237 SKEEP 000100 another flag to prevent swap out
238 SDLYU 000200 delayed unlock of pages
239 SWEXIT 000400 working on exiting
240 SPHYSIO 000800 doing physical i/o (bio.c)
241 SVFORK 001000 process resulted from vfork()
242 SVFDONE 002000 another vfork flag
243 SNOVM 004000 no vm, parent in a vfork()
dee48434 244 SPAGI 008000 init data space on demand from inode
24115aa8
KM
245 SANOM 010000 system detected anomalous vm behavior
246 SUANOM 020000 user warned of anomalous vm behavior
247 STIMO 040000 timing out during sleep
248 SDETACH 080000 detached inherited by init
dee48434 249 SOUSIG 100000 using old signal mechanism
24115aa8
KM
250.fi
251.PD
252.PP
c3f41f75
AH
253A process that has exited and has a parent that has not
254yet waited for the process is marked <defunct>; a process
24115aa8
KM
255which is blocked trying to exit is marked <exiting>;
256.I Ps
257makes an educated guess as to the file name
258and arguments given when the process was created
259by examining memory or the swap area.
260The method is inherently somewhat unreliable and in any event
261a process is entitled to destroy this information,
262so the names cannot be counted on too much.
263.SH FILES
9a22b5c6 264.ta \w'/etc/psdatabase 'u
24115aa8
KM
265/vmunix system namelist
266.br
267/dev/kmem kernel memory
268.br
269/dev/drum swap device
270.br
271/vmcore core file
272.br
273/dev searched to find swap device and tty names
9a22b5c6 274.br
53829504 275/etc/psdatabase system namelist, device, and wait channel information
24115aa8
KM
276.SH "SEE ALSO"
277kill(1), w(1)
278.SH BUGS
279Things can change while
280.I ps
281is running; the picture it gives is only a close
282approximation to reality.