AC(8)
π AC(8) β connect time accounting π
okay bestie, so this is ac, section 8 of the System Manager's Manual, and she is literally the queen of connect time accounting. no cap. let's get into it π
β¨ NAME β¨
ac β connect time accounting πΈ
β¨ SYNOPSIS β¨
ac [-dp] [-t tty] [-w wtmp] [users ...]
β¨ DESCRIPTION β¨
so here's the vibe: by default, a record of individual login and logout times gets written down by login(1) and init(8) respectively, and they send it to syslogd(8). π
then ac slides in, examines those records, and writes the accumulated connect time β in hours β for all logins to the standard output. that's it. that's the whole job. slay π
π the options, bestie
-dβ display the connect times in 24 hour chunks. like, day-by-day energy β°-pβ print individual users' totals. so you get per-person receipts instead of one big number π§Ύβ¨-tttyβ only do accounting logins on certain ttys. and okay this one is the fun one: the tty spec can start with!to mean not this tty, and can end with*to mean all similarly named ttys. and yes you can stack multiple-tflags, go off π-wwtmpβ read connect time data fromwtmpinstead of the default, which is reading fromlog(1). switch up your source, why not π¦users ...β display totals for the given individuals only. just the besties you asked for, nobody else π
and if no arguments are given at all?acdisplays the total connect time for all accounts with login sessions recorded inlog(1). the whole group chat, basically π
β¨ FILES β¨
/var/run/utmpxβ the connect time accounting file ποΈ
β¨ EXIT STATUS β¨
ac exits 0 on success, and >0 if an error occurs. clean exits only, fr fr β¨
β¨ EXAMPLES β¨
okay so picture this: you want times recorded in modems to be charged out at a different rate than the other ones. iconic. do this:
ac -p -t "ttyd*" > modems
ac -p -t "!ttyd*" > other
two files, two rates, zero stress π«Ά
β¨ SEE ALSO β¨
log(1), login(1), getutxent(3), utmpx(5), launchd(8), sa(8), syslogd(8) π₯
β¨ HISTORY β¨
an ac command appeared in Version 5 AT&T UNIX. and this version of ac was written for NetBSD 0.9A, from the specification provided by various systems' manual pages. main character origin story honestly π
π and that's the whole page! this one's the Debian build, dated February 14, 2020 β happy valentine's day to connect time accounting and to you, bestie π
π¦ where this page comes from
- nixpkgs unstable: system_cmds 1042.100.6.0.1
- Copyright (c) 1994 Simon J. Gerraty
- Copyright (c) 1994 Christopher G. Demetriou
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms