Scripting: How do I process accounting file /var/account/pact?
The file /var/account/pacct can not be used directly as it does not store accounting data in clear text format. Each time a process terminates a record for this process is appended to the accounting file.
In order to use this file to generate customize report from perl or shell script you need to convert this file in text format. You need to use dump-acct command which print an acct/pacct file in human-readable format.
# dump-acct /var/account/pacct
All fields are separated by vertical line. Fields are: command, user time, system time, effective time, uid, gid, memory, io, time. To print username and command you can use awk command in pipe as follows:
# dump-acct /var/account/pacct | awk -F'|' '{ print $1 " = " $5 }'
Please note that to print an utmp file in human-readable format use command dump-utmp as follows:
# dump-utmp /var/log/wtmp
E-mail this to a friend
Printable version
Related Other Helpful FAQs:
- Find Out Which Commands Were Run on My Linux Server
- How To Find and Overcome Shell Command Line Length Limitations
- Understanding /var/account/pacct OR /var/account/acct - Acct File Format
- Linux find out what process are eating all memory and time allocated to process
- renice command: Change the Priority of a Already Running Process
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!



Recent Comments
Yesterday ~ 7 Comments
Yesterday ~ 2 Comments
Yesterday ~ 3 Comments
Yesterday ~ 3 Comments
09/05/2008 12:28 pm (2 days ago) ~ 70 Comments