I need to see how many times users logged in.
I used last | sort | uniq -c but it gave me bad data
I need to sort them by number of times they logged in and only show username and number of time.
for example:
username number of logins
userb 36
usera 12
userd 12
userc 8
last | cut -c 1-8 | sort | uniq -cdoes the job but does not the format it the way you want. it also reports blank lines, reboots etc.awkwill do the job better. – user68186 Feb 04 '23 at 20:54last | cut -c 1-8 | sort | uniq -c | sort -rworked great. thanks. – Usermaxn Feb 04 '23 at 21:12