If I ran this on OS X:
last -10 | awk '{print $1}'
I get: chop
chop
chop
chrihopk
reboot
shutdown
chop
chop
chop
chrihopk
How to use sed or awk to get the most common custom "chop"?
ADDITIONAL CHANGE TO QUESTION:
Our local administrator account hinders the results (username: support), and often we have a new starter in the client window.
How can i change
last -1
to omit the following and return the last valid username:
Support
reboot
shutdown
thanks
source share