Hi, this is Sandra Henry-Stocker, author of
the “Unix as a Second Language” blog on NetworkWorld.
In this Linux tip, we’re going to look at the who command and the details it will show
you regarding who is logged in and about the system.
The most obvious use of the who command is to ask who is logged in.
Notice that the output shows us not just who is logged in, but where they logged in from
and when they logged in. The first column in this output shows us the usernames, the
second is their terminal IDs, but :0 means the system console. The third shows us the
date and time each user logged in and, if they logged in from another system, the IP
address of that system. One user in this example has been logged into
the system console for days while another logged in today from another system.
But that’s not all the who command can tell you. Want to see when the system was last
booted? Try who -b: Want to see what the current run level of
the system is? Try who -r. Want a simple count of logged in users along
with a one-line list of usernames? Try who -q.
Don’t forget that you can create aliases for these commands
if who -b, who -r and who -q don’t fall from your lips.
That’s your Linux tip for the who command. If you have questions or would like to suggest
a topic, please add a comment below. And don’t forget to subscribe to the IDG Tech(talk)
channel on YouTube. If you liked this video, please hit the like
and share buttons. For more Linux tips, be sure to follow us on Facebook, YouTube and