Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ac(1m) [v7 man page]

AC(1M)																	    AC(1M)

NAME
ac - login accounting SYNOPSIS
ac [ -w wtmp ] [ -p ] [ -d ] [ people ] ... DESCRIPTION
Ac produces a printout giving connect time for each user who has logged in during the life of the current wtmp file. A total is also pro- duced. -w is used to specify an alternate wtmp file. -p prints individual totals; without this option, only totals are printed. -d causes a printout for each midnight to midnight period. Any people will limit the printout to only the specified login names. If no wtmp file is given, /usr/adm/wtmp is used. The accounting file /usr/adm/wtmp is maintained by init and login. Neither of these programs creates the file, so if it does not exist no connect-time accounting is done. To start accounting, it should be created with length 0. On the other hand if the file is left undis- turbed it will grow without bound, so periodically any information desired should be collected and the file truncated. FILES
/usr/adm/wtmp SEE ALSO
init(8), login(1), utmp(5). AC(1M)

Check Out this Related Man Page

ac(8)							      System Manager's Manual							     ac(8)

NAME
ac - Outputs connect-session records SYNOPSIS
ac [-dp] [-w filename] [user(s) ...] FLAGS
Outputs the total connect time for each midnight-to-midnight period for which a wtmp file exists. When user(s) is specified, this flag lim- its the output to the login names specified by any user(s) parameter(s). Outputs the connect time total by individual login name of the user specified with the -p flag and the user(s) parameter. Omission of this flag permits a total only for the midnight-to-midnight time period for all logged in users to be produced. Specifies a wtmp file other than the /var/adm/wtmp file. The wtmp file you access for data may have been created automatically by some shell script administration command (for example, runacct) or manually by the system adminis- trator when the original /var/adm/wtmp file becomes too large. DESCRIPTION
The ac command prints to the default output device the total connect time in hours to the nearest hundredth for all users, or the connect time for any user(s) specified with the -p flag. It also prints the names of users specified by the user(s) parameter who have logged in during the life of the current /var/adm/wtmp file. Connect-time records are written by the init and the login programs and are collected in the /var/adm/wtmp file, when such a file exists. When a /var/adm/wtmp file does not exist, no connect-time accounting records are written; consequently, when connect-time records are wanted, the system administrator should create a /var/adm/wtmp file that has an initial record length of 0 (zero). Records in wtmp files (there may be more than one such file) should be processed periodically to keep the files from becoming too large. When you use the runacct command in a shell script, additional wtmp files can be automatically created whenever the current wtmp file becomes too large. You can output the contents of any of these other files when you specify the -w flag and the desired wtmp filename. The ac command is run independently with respect to any accounting shell procedure created or run by any of the acct/* shell procedures or runacct commands. EXAMPLES
To obtain an output of the total connect time for all users who have logged in during the life of the current wtmp data file, enter: /usr/sbin/ac To obtain an output of the total connect time for grossman and mcwhinney as recorded in the default wtmp data file, enter: /usr/sbin/ac grossman mcwhinney To obtain an output of the connect time subtotals for grossman and mcwhinney as recorded in the default wtmp data file, enter: /usr/sbin/ac -p grossman mcwhinney FILES
Specifies the command path. Is the active data file for the collection of connect-time records. RELATED INFORMATION
Commands: login(1), init(8) delim off ac(8)
Man Page