Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 721  / 2 Years ago, mon, august 15, 2022, 8:20:07

I want to get a list that shows how many times each user logged in to the system.



Something along the lines



user1 45
user2 134
user3 200

More From » login

 Answers
5
 last | cut -d' ' -f1 | sort | uniq -c | sort -rn


It'll output something like:



189 user1
73 user2
...
7 reboot
...
1 wtmp
1


When the username column contain 'reboot' it means system reboot, not a login.
When the username column contain wtmp or it's empty it's also not a login.


[#38042] Wednesday, August 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
imonove

Total Points: 82
Total Questions: 113
Total Answers: 106

Location: Saint Vincent and the Grenadines
Member since Wed, Nov 3, 2021
3 Years ago
;