Displays summaries of process-accounting records for selected processes.
/usr/sbin/acct/acctcom [ [ -q | -o File ] | [ -a ] [ -b ] [ -c Classname ] [-f ] [ -h ] [ -i ] [ -k ] [ -m ] [ -r ] [ -t ] [ -v ] [ -w [ -X ] [ -W ]] [ -C Seconds ] [ -g Group ] [ -H Factor ] [ -I Number ] [ -l Line ] [ -n Pattern ] [ -O Seconds ] [ -u User ] [ -e Time ] [ -E Time ] [ -s Time ] [ -S Time ] [ -@ [ WparName ] ] [ 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)
Item | Description |
---|---|
-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 Classname | Selects processes belonging to the specified
class. Note: Accounting data cannot be retrieved for a deleted class.
|
-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. |
-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:
|
-H Factor | Shows only the processes that exceed the value of the Factor parameter. This factor, called the hog factor, is computed as:
|
-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:
|
-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. |
-w | Displays the class names to which the processes belong. |
-W | Prints all available characters of each user name instead of truncating to the first 8 characters. The output is also widened to 132 characters allowing the user name to use the additional space. The -W option is mutually exclusive with the -X option. When both flags are used the second flag is ignored. |
-X | Print all available characters of each user name instead of truncating to the first 8 characters. The user name is also moved to the last column of the output. The -X option is mutually exclusive with the -W option. When both flags are used the second flag is ignored. |
-@ [ WparName ] | Displays summaries of process-accounting records
for selected processes per workload partition. If a workload partition is specified using
the WparName parameter, the accounting records for the specified workload partition are displayed.
If no workload partition is specified,
the accounting records for all of the workload partitions are displayed.
A workload partition name is
displayed for each record. The -@ option is not supported when executed within a workload partition. |
Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.
/usr/sbin/acct/acctcom -O 2 < /var/adm/pacct
The process information is read from the /var/adm/pacct file./usr/sbin/acct/acctcom -g Finance < /var/adm/pacct
The process information is read from the /var/adm/pacct file./usr/sbin/acct/acctcom -l /dev/console -s 17:00
The process information is read from the /var/adm/pacct file
by default./usr/sbin/acct/acctcom -X < /var/adm/pacct
The process information is read from the /var/adm/pacct file.acctcom -@ warpath < /var/adm/pacct
The process information is read from the /var/adm/pacct file.acctcom -@ < /var/adm/pacct
The process information is read from the /var/adm/pacct file.Item | Description |
---|---|
/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. |