The who command is used to determine the details of users currently logged in to a system. The output of the who command includes the user name, the name of the system from which the user is connected, and the date and time that the user has been connected since.

Syntax

The syntax of the who command is:

For examples, who command without any options:

$ who
geek    console  Sep  4 21:11
geek    ttys000  Sep  5 19:36

who Command options

The -u option can be used to see how long users have been idle. A dot indicates that the users were active up to the last minute, old indicates that the users have been inactive for over 24 hours, and anything between 2 minutes and 23 hours 59 minutes shows the length of time they have been idle. The “am i” option displays information only for the user who runs the command.

$ who -u
geek    console  Sep  4 21:11  old  	   131
geek    ttys000  Sep  5 19:36   .   	  3874
$ who am i
geek    ttys000  Sep  5 19:36

who Command Examples

1. To see who is logged in:

2. To see all the users logged in:

3. To see last time of system boot:

4. To see the dead processes:

5. To see the column headings:

6. To print system login processes:

7. To print active processes spawned by init:

8. To count the all logins:

9. To print the current runlevel:

10. To print system last clock change: