1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
'\" te
.\" Copyright 1989 AT&T
.\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH ACCTCOM 1 "Jan 11, 1996"
.SH NAME
acctcom \- search and print process accounting files
.SH SYNOPSIS
.LP
.nf
\fBacctcom\fR [\fB-abfhikmqrtv\fR] [\fB-C\fR \fIsec\fR] [\fB-e\fR \fItime\fR] [\fB-E\fR \fItime\fR]
[\fB-g\fR \fIgroup\fR] [\fB-H\fR \fIfactor\fR] [\fB-I\fR \fIchars\fR] [\fB-l\fR \fIline\fR]
[\fB-n\fR \fIpattern\fR] [\fB-o\fR \fIoutput-file\fR] [\fB-O\fR \fIsec\fR] [\fB-s\fR \fItime\fR]
[\fB-S\fR \fItime\fR] [\fB-u\fR \fIuser\fR] [\fIfilename\fR]...
.fi
.SH DESCRIPTION
.sp
.LP
The \fBacctcom\fR utility reads \fIfilename\fRs, the standard input, or
\fB/var/adm/pacct\fR, in the form described by \fBacct.h\fR(3HEAD) and writes
selected records to standard output. Each record represents the execution of
one process. The output shows the \fBCOMMAND NAME\fR, \fBUSER\fR,
\fBTTYNAME\fR, \fBSTART TIME\fR, \fBEND TIME\fR, \fBREAL (SEC)\fR, \fBCPU
(SEC)\fR, \fBMEAN SIZE (K)\fR, and optionally, \fBF\fR (the
\fBfork()\fR/\fBexec()\fR flag: \fB1\fR for \fBfork()\fR without \fBexec()\fR),
\fBSTAT\fR (the system exit status), \fBHOG FACTOR\fR, \fBKCORE MIN\fR, \fBCPU
FACTOR\fR, \fBCHARS TRNSFD\fR, and \fBBLOCKS\fR \fBREAD\fR (total blocks read
and written).
.sp
.LP
A `\fB#\fR' is prepended to the command name if the command was executed with
super-user privileges. If a process is not associated with a known terminal, a
`\fB?\fR' is printed in the \fBTTYNAME\fR field.
.sp
.LP
If no \fIfilename\fR is specified, and if the standard input is associated
with a terminal or \fB/dev/null\fR (as is the case when using `\fB&\fR\&' in
the shell), \fB/var/adm/pacct\fR is read; otherwise, the standard input is
read.
.sp
.LP
If any \fIfilename\fR arguments are given, they are read in their respective
order. Each file is normally read forward, that is, in chronological order by
process completion time. The file \fB/var/adm/pacct\fR is usually the current
file to be examined; a busy system may need several such files of which all but
the current file are found in \fB/var/adm/pacct\fIincr\fR\fR.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 18n
Show some average statistics about the processes selected. The statistics will
be printed after the output records.
.RE
.sp
.ne 2
.na
\fB\fB-b\fR\fR
.ad
.RS 18n
Read backwards, showing latest commands first. This option has no effect when
standard input is read.
.RE
.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 18n
Print the \fBfork()\fR/\fBexec()\fR flag and system exit status columns in the
output. The numeric output for this option will be in octal.
.RE
.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.RS 18n
Instead of mean memory size, show the fraction of total available \fBCPU\fR
time consumed by the process during its execution. This "hog factor" is
computed as (total \fBCPU\fR time)/(elapsed time).
.RE
.sp
.ne 2
.na
\fB\fB-i\fR\fR
.ad
.RS 18n
Print columns containing the \fBI/O\fR counts in the output.
.RE
.sp
.ne 2
.na
\fB\fB-k\fR\fR
.ad
.RS 18n
Instead of memory size, show total kcore-minutes.
.RE
.sp
.ne 2
.na
\fB\fB-m\fR\fR
.ad
.RS 18n
Show mean core size (the default).
.RE
.sp
.ne 2
.na
\fB\fB-q\fR\fR
.ad
.RS 18n
Do not print any output records, just print the average statistics as with the
\fB-a\fR option.
.RE
.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.RS 18n
Show \fBCPU\fR factor (user-time/(system-time + user-time)).
.RE
.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 18n
Show separate system and user \fBCPU\fR times.
.RE
.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 18n
Exclude column headings from the output.
.RE
.sp
.ne 2
.na
\fB\fB-C\fR \fIsec\fR\fR
.ad
.RS 18n
Show only processes with total \fBCPU\fR time (system-time + user-time)
exceeding \fIsec\fR seconds.
.RE
.sp
.ne 2
.na
\fB\fB-e\fR \fItime\fR\fR
.ad
.RS 18n
Select processes existing at or before \fItime\fR.
.RE
.sp
.ne 2
.na
\fB\fB-E\fR \fItime\fR\fR
.ad
.RS 18n
Select processes ending at or before \fItime\fR. Using the same \fItime\fR for
both \fB-S\fR and \fB-E\fR shows the processes that existed at \fItime\fR.
.RE
.sp
.ne 2
.na
\fB\fB-g\fR \fIgroup\fR\fR
.ad
.RS 18n
Show only processes belonging to \fIgroup\fR. The \fIgroup\fR may be designated
by either the group \fBID\fR or group name.
.RE
.sp
.ne 2
.na
\fB\fB-H\fR \fIfactor\fR\fR
.ad
.RS 18n
Show only processes that exceed \fBfactor\fR, where factor is the "hog factor"
as explained in option \fB-h\fR above.
.RE
.sp
.ne 2
.na
\fB\fB-I\fR \fIchars\fR\fR
.ad
.RS 18n
Show only processes transferring more characters than the cutoff number given
by \fIchars\fR.
.RE
.sp
.ne 2
.na
\fB\fB-l\fR \fIline\fR\fR
.ad
.RS 18n
Show only processes belonging to terminal \fB/dev/term/line\fR.
.RE
.sp
.ne 2
.na
\fB\fB-n\fR \fIpattern\fR\fR
.ad
.RS 18n
Show only commands matching \fIpattern\fR that may be a regular expression as
in \fBregcmp\fR(3C), except \fB+\fR means one or more occurrences.
.RE
.sp
.ne 2
.na
\fB\fB-o\fR \fIoutput-file\fR\fR
.ad
.RS 18n
Copy selected process records in the input data format to \fIoutput-file\fR;
suppress printing to standard output.
.RE
.sp
.ne 2
.na
\fB\fB-O\fR \fIsec\fR\fR
.ad
.RS 18n
Show only processes with \fBCPU\fR system time exceeding \fIsec\fR seconds.
.RE
.sp
.ne 2
.na
\fB\fB-s\fR \fItime\fR\fR
.ad
.RS 18n
Select processes existing at or after \fItime\fR, given in the format
\fIhr\fR\|[\|:\fImin\fR\|[\|:\fIsec\fR\|]\|].
.RE
.sp
.ne 2
.na
\fB\fB-S\fR \fItime\fR\fR
.ad
.RS 18n
Select processes starting at or after \fItime\fR.
.RE
.sp
.ne 2
.na
\fB\fB-u\fR \fIuser\fR\fR
.ad
.RS 18n
Show only processes belonging to \fIuser\fR. The user may be specified by a
user \fBID\fR, a login name that is then converted to a user \fBID\fR,
`\fB#\fR' (which designates only those processes executed with superuser
privileges), or `\fB?\fR' (which designates only those processes associated
with unknown user \fBID\fRs).
.RE
.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/group\fR\fR
.ad
.RS 22n
system group file
.RE
.sp
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 22n
system password file
.RE
.sp
.ne 2
.na
\fB\fB/var/adm/pacct\fIincr\fR\fR\fR
.ad
.RS 22n
active processes accounting file
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
CSI Enabled
.TE
.SH SEE ALSO
.sp
.LP
.BR ps (1),
.BR acct (2),
.BR regcmp (3C),
.BR acct.h (3HEAD),
.BR utmp (5),
.BR attributes (7),
.BR acct (8),
.BR acctcms (8),
.BR acctcon (8),
.BR acctmerg (8),
.BR acctprc (8),
.BR acctsh (8),
.BR fwtmp (8),
.BR runacct (8),
.BR su (8)
.sp
.LP
\fISystem Administration Guide: Basic Administration\fR
.SH NOTES
.sp
.LP
\fBacctcom\fR reports only on processes that have terminated; use \fBps\fR(1)
for active processes.
|