Formats and displays files in tacct format.
/usr/sbin/acct/prtacct [ -f Fields ] [ -v ] File [ "Heading" ]
The prtacct command formats and displays any total-accounting file; these files are in tacct format. You can enter this command to view any tacct file, such as the daily reports on connect time, process time, disk usage, and printer usage. To specify a title for the report with the Heading parameter, enclose the heading text in " " (quotation marks).
|-f Fields||Selects fields to be displayed, using the field-selection mechanism of the acctmerg command.|
|-v||Produces verbose output in which more precise notation is used for floating-point numbers.|
Access Control: This command should grant execute (x) access only to members of the adm group.
To format and display selected records from the total accounting file for connect-time accounting, you first must create a file upon which to execute the prtacct command. In this example, you create the tacct file using the acctcon1 and acctcon2 commands. Enter:
tail /var/adm/wtmp > wtmp.sav acctcon1 -t < wtmp.sav | sort +1n +2 | acctcon2 > tacct
If you created this file previously to process connect-time accounting data, you do not need to create it again.
The next step uses the prtacct command with the -f flag to display the fields of data in the total-accounting file that you want to see. The text for a heading can be included in quotation marks. To view the login name, prime connect-time, and nonprime connect-time records, and include the heading, Connect-time Accounting, enter:
prtacct -f 2,11,12 tacct "Connect-time Accounting"
You can also use this command to format and display other total-accounting files, such as the daily reports on process time, disk usage, and printer usage.
|/usr/sbin/acct||The path to the accounting commands.|
|/var/adm/pacct||Current file for process accounting.|
|/var/adm/pacct*||Used if the pacct file gets too large.|
The acctcon1 or acctcon2 command, acctdisk or acctdusg command, acctmerg command, acctprc1, acctprc2, or accton command.
The tacct structure in the acct file format.
For more information about the Accounting System, the preparation of daily and monthly reports, and the accounting files, see the Accounting Overview in AIX 5L Version 5.1 System Management Guide: Operating System and Devices.
Setting Up an Accounting System in AIX 5L Version 5.1 System Management Guide: Operating System and Devices explains the steps you must take to establish an accounting system.