Skip to content

Looking at user login time with the ac command

While not a very well known Linux command, ac can provide very useful stats on user login time. In its simplest form, it will show you how much time users have spent on the system in the time period covered by the wtmp file. All you have to type is “ac” to get a figure showing overall login time for all users.

$ ac
total 8360.60

The figure above indicates that users spent a total of 8,360.6 hours on the system. Looking at the wtmp file with the who command, we can see that the saved logins started on June 6th – a little more than 6 months earlier.

$ who /var/log/wtmp | head -2
shs tty2 2022-06-06 16:00 (tty2)
shs pts/1 2022-06-06 16:23 (

To look at the times by user, add the -p (people) argument.

To read this article in full, please click here

Source:: Network World – Data Center