.TH ac "" "" "Command"
.II /usr/adm/wtmp
.II "login accounting"
.PC "Summarize login accounting information"
\fBac \fR[ \fB\-dp \fR] [ \fB\-w\fR \fIwfile\fR ][ \fIusername ... \fR]
.PP
.HS
.SH Options:
.IC \fB\-d\fR
Itemize for each midnight-midnight period
.IC \fB\-p\fR
Itemize by individual users
.IC "\fB\-w\fI wtmp\fR"
Obtain raw statistics from \fIwtmp\fR rather than \fB/usr/adm/wtmp\fR
.Pp
If users are specified, only they are considered.
.HE
One of the accounting mechanisms available on the \*(CO system
is login accounting, which keeps track of the time each user
spends logged into the system.
Login accounting is enabled by creating the file
.BR /usr/adm/wtmp .
Thereafter, the routines
.BR date ,
.BR login ,
and
.B init
write raw accounting data to
.B /usr/adm/wtmp
to record the time, the name of the terminal, and the name
of the user for each date change, login, logout, or system reboot.
.PP
The command
.B ac
summarizes the accounting data that have accumulated for your system.
By default, it prints the total connect time found in
.BR /usr/adm/wtmp .
If its command line includes a user's login identifier,
.B ac
prints a summary only of that user's activity.
.PP
.B ac
recognizes the following command-line options:
.IP \fB\-d\fR 0.3i
Itemize the output into daily periods.
.B ac
defines a day as beginning at midnight.
.IP \fB\-p\fR
Print a summary for every user on your system.
.IP \fB\-w\fR
Read data from
.IR wfile .
By default,
.B ac
reads its data from
.BR /usr/adm/wtmp .
.SH "See Also"
.Xr commands, commands
.Xr date, date
.Xr init, init
.Xr login, login
.Xr sa, sa
.Xr utmp.h utmp.h
.SH Notes
File
.B /usr/adm/wtmp
can become very large; therefore,
you should truncated it periodically.
Special care should be taken if you have enabled login accounting
and your system has limited amounts of free disk space.
