Let's say I am trying to find out how many times someone has logged into the machine. Use last to display all the different logins, several names pop up, some multiple times. All I have been able to figure out is the total number of logins, but I can't determine how to compare if $1(user name) is there more than once, and ontop of that count it if it is.
ex.
toyoung
rasmith
toyoung
output i'm looking for would be
toyoung 2
rasmith 1
here's what i have so far:
last | awk ' END {print "Number of logins:", NR} '