I am trying to figure out how to get a list of logged in users and then with pipes sorting this list and only show every unique occurence.
I am almost there but the problem is that the "who-command" doesnt seem to allow to list just the user by name - it lists others parameters such as logintime, threads and so on. That results in making every every line unique.
here is my command
who | sort | uniq
and the result:
eric :3 2014-09-25 15:23 (:3)
karen :0 2014-09-25 14:41 (:0)
karen pts/0 2014-09-25 14:48 (:0)
john :2 2014-09-25 15:23 (:2)
carol :1 2014-09-25 15:22 (:1)
carol pts/25 2014-09-25 15:22 (:1)
admin :4 2014-09-25 15:23 (:4)
So - how do I get a list of only the unique names in a list?