[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1

ac Command

Purpose

Prints connect-time records.

Syntax

/usr/sbin/acct/ac-d ] [  -p ] [  -w File ] [ User ... ]

Description

The ac command prints the total connect time for all users or the connect time for specified users. Records are based on who logged in during the life of the current wtmp data file.

Connect-time records are created by the init and the login programs and are collected in the /var/adm/wtmp file, if that file exists. The root user or a member of the adm group should create the /var/adm/wtmp file with an initial record length of 0 (zero). Records should be processed periodically to keep the file from becoming too full. If the file has not been created, the following error message is returned:

No /var/adm/wtmp

If the file becomes too full, additional wtmp files are created. These files can be printed, if specified with the -w flag.

Flags

-d Creates a printout for each day, from midnight to midnight.
-p Prints connect-time totals by individual login. Without this flag, a total for the time period is printed.
-w File Specifies a wtmp file other than the /var/adm/wtmp file.

Security

Access Control: This command should grant execute (x) access to all users.

Examples

  1. To obtain a printout of the connect time for all users who logged in during the life of the current wtmp data file, enter:

    /usr/sbin/acct/ac
  2. To obtain a printout of the total connect time for users smith and jones, as recorded in the current wtmp data file, enter:

    /usr/sbin/acct/ac smith jones
  3. To obtain a printout of the connect-time subtotals for users smith and jones, as recorded in the current wtmp data file, enter:
    /usr/sbin/acct/ac  -p smith jones

Files

/usr/sbin/acct/ac Contains the ac command.
/var/adm/wtmp Contains the active data file for the collection of connect-time records.

Related Information

The init and login commands.

For more information about the Accounting System, the preparation of daily and monthly reports, and the accounting files, see Accounting Overview in AIX 5L Version 5.2 System Management Concepts: Operating System and Devices.

Setting Up an Accounting System in AIX 5L Version 5.2 System Management Guide: Operating System and Devices explains the steps you must take to establish an accounting system.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]