I want to show the online users using the who
command but I want to have a unique output and not show any duplicates. I piped the output into awk
but I am not very familiar with that, is this the right way and how to proceed?
Print unique of who command
awksortwho
Best Answer
It's easier to just do it with
sort
:The
-u
flag asks for "unique" lines (suppress duplicates). The key flag (-k
) says to only consider the first word in each line for purposes of sorting and uniqueness.