System Administration Guide, Volume 2

Looking at the pacct File With acctcom

At any time, you can examine the contents of the /var/adm/pacctn files, or any file with records in the acct.h format, by using the acctcom program. If you don't specify any files and don't provide any standard input when you run this command, acctcom reads the pacct file. Each record read by acctcom represents information about a dead process (active processes may be examined by running the ps command). The default output of acctcom provides the following information:

The following information can be obtained by using options to acctcom:

Table 32-6 acctcom Options

Option 

Description 

-a

Shows some average statistics about the processes selected. (The statistics are printed after the output is recorded.)  

-b

 

Reads the files backward, showing latest commands first. (This has no effect if reading standard input.)  

-f

Prints the fork/exec flag and system exit status columns. (The output is an octal number.)

-h

Instead of mean memory size, shows the hog factor, which is the fraction of total available CPU time consumed by the process during its execution. Hog factor = total_CPU_time/elapsed_time.

-i

Prints columns containing the I/O counts in the output.  

-k

Shows total kcore minutes instead of memory size.

-m

Shows mean core size (this is the default).  

-q

Prints average statistics, not output records 

-r

Shows CPU factor: user_time/(system_time + user_time).

-t

Shows separate system and user CPU times.  

-v

Excludes column headings from the output.  

-C sec

Shows only processes with total CPU time (system plus user) exceeding sec seconds.

-e time

Shows processes existing at or before time, given in the format hr[:min[:sec]].

-E time

Shows processes starting at or before time, given in the format hr[:min[:sec]]. Using the same time for both -S and -E, show processes that existed at the time.

-g group

Shows only processes belonging to group.

-H factor

Shows only processes that exceed factor, where factor is the "hog factor" (see the -h option).

-I chars

Shows only processes transferring more characters than the cutoff number specified by chars.

-l line

Show only processes belonging to the terminal /dev/line.

-n pattern

Shows only commands matching pattern (a regular expression except that "+" means one or more occurrences).

-o ofile

Instead of printing the records, copys them in acct.h format to ofile.

-O sec

Shows only processes with CPU system time exceeding sec seconds.

-s time

Show processes existing at or after time, given in the format hr[:min[:sec]].

-S time

Show processes starting at or after time, given in the format hr[:min[:sec]].

-u user

Shows only processes belonging to user.