Using who

In addition to date and uptime, there is another Unix command that can help you manage your system. This command is called who. This is not the same as whoami, a command you learned earlier in this book. The whoami command returns only the username of the person currently logged in and accessing the shell prompt. By using who, you can see more information.

Unix is a multiuser system; this means that there can be many different users logged in at any given time. Therefore, it's important to know how to see who is also logged in to your system, and you can do this by using the who command. Use this command as follows:

>who

rob     pts/0 April 7, 2005 (console)
mary    pts/1 April 7, 2005
jane    pts/2 April 7, 2005
admin   pts/3 April 7, 2005

Get SAMS Teach Yourself Unix in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.