How to Find the Total Connect Time For User(s) in UNIX / Linux

The ac command prints the total connect time for all users or the connect time for specified users. Records are based on who logged in during the life of the current wtmp data file.

Command Options

-d = Creates a printout for each day, from midnight to midnight.
-p = Prints connect-time totals by individual login.
Without this flag, a total for the time period is printed.

Examples

Get the connect time for all users who logged in during the life of the current wtmp data file:

/usr/sbin/acct/ac
total    23.49

Get the total connect time for user itsiti and araadm, as recorded in the current wtmp data file:

/usr/sbin/acct/ac itsiti araadm
total    23.50

Get the connect-time subtotals for users itsiti and araadm, as recorded in the current wtmp data file:

/usr/sbin/acct/ac -p itsiti araadm

You May Also Like

Leave a Reply?