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, --file filename β€” 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 of acs 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-leniency num β€” 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 --timewarps flag is used.
  • --tw-suspicious num β€” 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 --timewarps flag 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 of ac to 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 out wtmp(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 🌸🫢