Displays selected process accounting record summaries.
/usr/sbin/acct/acctcom [ [ -q | -o File ] | [ -a ] [ -b ] [ -f ] [ -h ] [ -i ] [ -k ] [ -m ] [ -r ] [ -t ] [ -v ] ] [ -C Seconds ] [ -g Group ] [ -H Factor ] [ -I Number ] [ -l Line ] [ -n Pattern ] [ -O Seconds ] [ -u User ] [ -e Time ] [ -E Time ] [ -s Time ] [ -S Time ] [ File ... ]
The acctcom command reads process accounting records from files specified by the File parameter from standard input or from the /var/adm/pacct file. Then the acctcom command writes the records you request to standard output. This command is stored in the /usr/sbin/acct directory, for access by all users.
If you do not specify a File parameter and if standard input is assigned to a workstation or to the /dev/null file, as when a process runs in the background, the acctcom command reads the /var/adm/pacct file.
If you specify a File parameter, the acctcom command reads each file chronologically by process completion time. Usually, the /var/adm/pacct file is the current file that you want the acctcom command to examine. Because the ckpacct procedure keeps this file from growing too large, a busy system may have several pacct files. All but the current file have the path name /var/adm/pacct?, where ? (question mark) represents an integer.
Each record represents one completed process. The default display consists of the command name, user name, tty name, start time, end time, real seconds, CPU seconds, and mean memory size (in kilobytes). These default items have the following headings in the output:
COMMAND START END REAL CPU MEAN NAME USER TTYNAME TIME TIME (SECS) (SECS) SIZE(K)
If a process was run by the root user, the process name is prefixed with a # (pound sign). If a process is not assigned to a known workstation ( for example, when the cron daemon runs the process), a ? (question mark) appears in the TTYNAME field.
Notes:
- The acctcom command only reports on processes that have finished. Use the ps command to examine active processes.
- If a specified time is later than the current time, it is interpreted as occurring on the previous day.
Access Control: This command should grant execute (x) access to all users.
-a | Shows some average statistics about the processes selected. The statistics are displayed after the output records. |
-b | Reads backwards, showing the most recent commands first. This flag has no effect when the acctcom command reads standard input. |
-C Seconds | Shows only processes whose total CPU time (system time + user time) exceeds the value specified by the Seconds variable. |
-e Time | Selects processes existing at or before the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss. |
-E Time | Selects processes ending at or before the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss. If you specify the same time for both the -E and -S flags, the acctcom command displays the processes that existed at the specified time. |
-f | Displays two columns related to the ac_flag field of the acct.h file: the first indicates use of the fork command to create a process, the second indicates the system exit value. Refer to the acct structure described in the acct file format in AIX Version 4.3 Files Reference. |
-g Group | Selects processes belonging to the specified group. You can specify either the group ID or the group name. |
-h | Instead of mean memory size, shows the fraction of total available CPU time consumed by the process (hog factor). This factor is computed as:
(total CPU time) / (elapsed time) |
-H Factor | Shows only the processes that exceed the value of the Factor parameter. This factor, called the hog factor, is computed as:
(total CPU time) / (elapsed time) |
-i | Displays columns showing the number of characters transferred in read or write operations (the I/O counts). |
-k | Instead of memory size, shows total kcore minutes (memory measurement in kilobyte segments used per minute of run time). |
-l Line | (lowercase L) Shows only processes belonging to workstation /dev/Line. |
-I Number | (uppercase i) Shows only processes transferring more than the specified number of characters. |
-m | Shows mean main-memory size. This is the default. The -h flag or -k flag turn off the -m flag. |
-n Pattern | Shows only commands matching the value of the Pattern variable, where Pattern is a regular expression. Regular expressions are described in the ed command. In addition to the usual characters, the acctcom command allows you to use a + (plus sign) as a special symbol for the preceding character. |
-o File | Copies selected process records to the specified file, keeping the input data format. This flag suppresses writing to standard output. This flag cannot be used with the -q flag. |
-O Seconds | Shows only processes with CPU system time exceeding the specified number of seconds. |
-q | Displays statistics but not output records. The statistics are the same as those displayed using the -a flag. The -q flag cannot be used with the -o flag. |
-r | Shows CPU factor. This factor is computed as:
(user-time) / (system-time + user-time) |
-s Time | Shows only those processes that existed on or after the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss. |
-S Time | Shows only those processes starting at or after the specified time. You can use the current locale to specify the order of hours, minutes, and seconds. The default order is hh:mm:ss. |
-t | Shows separate system and user CPU times. |
-u User | Shows only processes belonging to the specified user. Enter one of the following for the User variable: a user ID, a login name to be converted to a user ID, a # (pound sign) to select processes run by the root user, or a ? (question mark) to select processes associated with unknown user IDs. |
-v | Eliminates column headings from the output. |
/usr/sbin/acct/acctcom -O 2 < /var/adm/pacctThe process information is read from the /var/adm/pacct file.
/usr/sbin/acct/acctcom -g Finance < /var/adm/pacctThe process information is read from the /var/adm/pacct file.
/usr/sbin/acct/acctcom -l /dev/console -s 17:00The process information is read from the /var/adm/pacct file by default.
/usr/sbin/acct/acctcom | Contains the acctcom command. |
/var/adm/pacct | Contains the current process accounting file. |
/etc/group | Contains the basic group attributes of groups. |
/etc/passwd | Contains the basic attributes of users. |
The ed command, ps command, runacct command, su command.
The cron daemon.
The acct subroutine.
The acct file format, utmp, wtmp, failedlogin file format.
Accounting Commands in AIX Version 4.3 System Management Guide: Operating System and Devices.
For more information about the accounting system, the preparation of daily and monthly reports, and the accounting files, see the Accounting Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.
Setting Up an Accounting System in AIX Version 4.3 System Management Guide: Operating System and Devices describes the steps you must take to establish an accounting system.
in AIX Performance Monitoring and Tuning Commands in AIX Versions 3.2 and 4 Performance Tuning Guide
The environment File describes environment variables and their functions.