1AC(1) General Commands Manual AC(1)
2
3
4
6 ac - print statistics about users' connect time
7
9 ac [ -d | --daily-totals ] [ -y | --print-year ]
10 [ -p | --individual-totals ] [ people ]
11 [ -f | --file filename ] [ -a | --all-days ]
12 [ --complain ] [ --reboots ] [ --supplants ]
13 [ --timewarps ] [ --compatibility ]
14 [ --tw-leniency num ] [ --tw-suspicious num ]
15 [ -z | --print-zeros ] [ --debug ]
16 [ -V | --version ] [ -h | --help ]
17
19 ac prints out a report of connect time (in hours) based on the lo‐
20 gins/logouts in the current wtmp file. A total is also printed out.
21
22 The accounting file wtmp is maintained by init(8) and login(1). Nei‐
23 ther ac nor login creates the wtmp if it doesn't exist, no accounting
24 is done. To begin accounting, create the file with a length of zero.
25
26 NOTE: The wtmp file can get really big, really fast. You might want
27 to trim it every once and a while.
28
29 GNU ac works nearly the same u*x ac, though it's a little smarter in
30 several ways. You should therefore expect differences in the output of
31 GNU ac and the output of ac's on other systems. Use the command info
32 accounting to get additional information.
33
35 -d, --daily-totals
36 Print totals for each day rather than just one big total at the
37 end. The output looks like this:
38 Jul 3 total 1.17
39 Jul 4 total 2.10
40 Jul 5 total 8.23
41 Jul 6 total 2.10
42 Jul 7 total 0.30
43
44 -p, --individual-totals
45 Print time totals for each user in addition to the usual every‐
46 thing-lumped-into-one value. It looks like:
47 bob 8.06
48 goff 0.60
49 maley 7.37
50 root 0.12
51 total 16.15
52
53 people Print out the sum total of the connect time used by all of the
54 users included in people. Note that people is a space separated
55 list of valid user names; wildcards are not allowed.
56
57 -f, --file filename
58 Read from the file filename instead of the system's wtmp file.
59
60 --complain
61 When the wtmp file has a problem (a time-warp, missing record,
62 or whatever), print out an appropriate error.
63
64 --reboots
65 Reboot records are NOT written at the time of a reboot, but when
66 the system restarts; therefore, it is impossible to know exactly
67 when the reboot occurred. Users may have been logged into the
68 system at the time of the reboot, and many ac's automatically
69 count the time between the login and the reboot record against
70 the user (even though all of that time shouldn't be, perhaps, if
71 the system is down for a long time, for instance). If you want
72 to count this time, include the flag. *For vanilla ac compati‐
73 bility, include this flag.*
74
75 --supplants
76 Sometimes, a logout record is not written for a specific termi‐
77 nal, so the time that the last user accrued cannot be calculat‐
78 ed. If you want to include the time from the user's login to
79 the next login on the terminal (though probably incorrect), in‐
80 clude this you want to include the time from the user's login to
81 the next login on the terminal (though probably incorrect), in‐
82 clude this flag. *For vanilla ac compatibility, include this
83 flag.*
84
85 --timewarps
86 Sometimes, entries in a wtmp file will suddenly jump back into
87 the past without a clock change record occurring. It is impos‐
88 sible to know how long a user was logged in when this occurs.
89 If you want to count the time between the login and the time
90 warp against the user, include this flag. *For vanilla ac com‐
91 patibility, include this flag.*
92
93 --compatibility
94 This is shorthand for typing out the three above options.
95
96 -a, --all-days
97 If we're printing daily totals, print a record for every day in‐
98 stead of skipping intervening days where there is no login ac‐
99 tivity. Without this flag, time accrued during those interven‐
100 ing days gets listed under the next day where there is login ac‐
101 tivity.
102
103 --tw-leniency num
104 Set the time warp leniency to num seconds. Records in wtmp
105 files might be slightly out of order (most notably when two lo‐
106 gins occur within a one-second period - the second one gets
107 written first). By default, this value is set to 60. If the
108 program notices this problem, time is not assigned to users un‐
109 less the --timewarps flag is used.
110
111 --tw-suspicious num
112 Set the time warp suspicious value to num seconds. If two
113 records in the wtmp file are farther than this number of seconds
114 apart, there is a problem with the wtmp file (or your machine
115 hasn't been used in a year). If the program notices this prob‐
116 lem, time is not assigned to users unless the --timewarps flag
117 is used.
118
119 -y, --print-year
120 Print year when displaying dates.
121
122 -z, --print-zeros
123 If a total for any category (save the grand total) is zero,
124 print it. The default is to suppress printing.
125
126 --debug
127 Print verbose internal information.
128
129 -V, --version
130 Print the version number of ac to standard output and quit.
131
132 -h, --help
133 Prints the usage string and default locations of system files to
134 standard output and exits.
135
137 wtmp
138 The system wide login record file. See wtmp(5) for further de‐
139 tails.
140
142 The GNU accounting utilities were written by Noel Cragg
143 <noel@gnu.ai.mit.edu>. The man page was adapted from the accounting
144 texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>.
145
147 login(1), wtmp(5), init(8), sa(8)
148
149
150
151 1995 October 31 AC(1)