AC(1)
β¨ Welcome to AC(1) β¨
Okay bestie, this is the General Commands Manual page for ac π¦ It's the tool that tells you how long everyone's been connected, and it's giving main character energy π
π NAME π
ac β print statistics about users' connect time πΈ
π SYNOPSIS π
ac [ -d | --daily-totals ] [ -y | --print-year ]
[ -p | --individual-totals ] [ people ]
[ -f | --file filename ] [ -a | --all-days ]
[ --complain ] [ --reboots ] [ --supplants ]
[ --timewarps ] [ --compatibility ]
[ --tw-leniency num ] [ --tw-suspicious num ]
[ -z | --print-zeros ] [ --debug ]
[ -V | --version ] [ -h | --help ]
π¦ DESCRIPTION π¦
Okay so ac makes a report of connect time (in hours) using the logins and logouts in the current wtmp file π It also prints a total at the bottom, because of course it does β¨
The accounting file wtmp is looked after by init(8) and login(1). Neither ac nor login will make the wtmp file if it's missing, and if it doesn't exist, no accounting happens at all π To start accounting, create the file with a length of zero, and you're good to go π§
NOTE: The wtmp file can get really big, really fast π Trim it every once in a while, bestie, or it'll be a whole mess.
GNU ac works nearly the same as UNIX ac, but it's a little smarter in several ways π§ So expect some differences in the output between GNU ac and the ac on other systems. For more info, run info accounting π
π OPTIONS π
-d,--daily-totalsβ Shows a total for each day instead of one big total at the end. It looks like this:
Jul 3 total 1.17
Jul 4 total 2.10
Jul 5 total 8.23
Jul 6 total 2.10
Jul 7 total 0.30
-p,--individual-totalsβ Adds a time total for each user on top of the usual everything-lumped-together number π It looks like:
bob 8.06
goff 0.60
maley 7.37
root 0.12
total 16.15
- people β Gives you the combined connect time for everyone you list in people. It's a space-separated list of valid user names, and wildcards are not allowed, so no sneaky stuff π ββοΈ
-f,--filefilename β Reads from the file filename instead of the system's wtmp file π--complainβ If the wtmp file has a problem (a time-warp, a missing record, or whatever), it prints out an appropriate error π--rebootsβ Reboot records are NOT written when a reboot happens. They're written when the system starts back up, so it's impossible to know exactly when the reboot took place π People might have been logged in during the reboot, and lots ofacs automatically count the time between the login and the reboot record against the user. That's not fair if the system was down for ages, but if you do want to count it, include this flag. For vanilla ac compatibility, include this flag. β¨--supplantsβ Sometimes a logout record never gets written for a terminal, so the time the last user accrued can't be calculated π΅ If you want to count the time from the user's login to the next login on that terminal (though it's probably incorrect), include this flag. For vanilla ac compatibility, include this flag. π«Ά--timewarpsβ Sometimes entries in a wtmp file suddenly jump back into the past without a clock change record π°οΈ It's impossible to know how long someone was logged in when this happens. If you want to count the time between the login and the time warp against the user, include this flag. For vanilla ac compatibility, include this flag. π«--compatibilityβ Shorthand for typing out the three options above, so you can save your fingers π-a,--all-daysβ If you're printing daily totals, this prints a record for every single day π Without it, time from the days with no logins gets listed under the next day that does have login activity πΈ--tw-leniencynum β Sets the time warp leniency to num seconds. Records in wtmp files can be slightly out of order, especially when two logins happen within one second (the second one gets written first) π₯΄ By default this is 60. If the program notices this problem, time isn't assigned to users unless the--timewarpsflag is used.--tw-suspiciousnum β Sets the time warp suspicious value to num seconds. If two records in the wtmp file are farther apart than this many seconds, something's up with the wtmp file (or your machine hasn't been used in a year π). If the program notices this, time isn't assigned to users unless the--timewarpsflag is used.-y,--print-yearβ Shows the year when displaying dates π-z,--print-zerosβ If a total for any category is zero (the grand total doesn't count), it gets printed. By default, zeros are hidden π--debugβ Prints verbose internal info, for when you need the tea π΅-V,--versionβ Prints the version number ofacto standard output and quits π-h,--helpβ Prints the usage string and the default locations of system files to standard output, then exits π§
π FILES π
wtmpβ The system-wide login record file. Check outwtmp(5)for the deets π
π«Ά AUTHOR π«Ά
The GNU accounting utilities were written by Noel Cragg <noel@gnu.ai.mit.edu>. The man page was adapted from the accounting texinfo page by Susan Kleinmann <sgk@sgk.tiac.net> π
π¦ SEE ALSO π¦
login(1), wtmp(5), init(8), sa(8) β¨
Okay that's the whole tea, bestie! β This page is from 2010 August 16 and it's AC(1) all the way through π You're literally so smart for reading it, periodt πΈπ«Ά
π¦ where this page comes from
- alpine 3.22: acct-doc 6.6.4-r2 Β· GPL-3.0-or-later
- alpine 3.23: acct-doc 6.6.4-r2 Β· GPL-3.0-or-later
- alpine 3.24: acct-doc 6.6.4-r2 Β· GPL-3.0-or-later
- centos-stream 10: psacct 6.6.4-26.el10 Β· GPL-3.0-or-later
- centos-stream 9: psacct 6.6.4-13.el9 Β· GPLv3+
- debian bookworm: acct 6.6.4-5+b1 Β· GPL-3.0-only
- debian trixie: acct 6.6.4-8 Β· GPL-3.0-only
- fedora 43: psacct 6.6.4-25.fc43 Β· GPL-3.0-or-later
- fedora 44: psacct 6.6.4-26.fc44 Β· GPL-3.0-or-later
- nixos 26.05: acct 6.6.4
- nixpkgs unstable: acct 6.6.4
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- opensuse-leap 16.0: acct 6.6.4-bp160.1.13 Β· GPL-2.0-or-later
- ubuntu jammy: acct 6.6.4-4build2 Β· GPL-3.0-only
- ubuntu noble: acct 6.6.4-5build1 Β· GPL-3.0-only
- ubuntu noble: acct 6.6.4-5ubuntu0.24.04.1 Β· GPL-3.0-only
- ubuntu questing: acct 6.6.4-10
- ubuntu resolute: acct 6.6.4-10build1 Β· GPL-3.0-or-later
- ubuntu stonking: acct 6.6.4-11 Β· GPL-3.0-or-later
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms