How to Use the Who Command in Linux
The “who” reveals users who is currently logged in the system. It shows some information such as the username, the timestamp, and the IP address.
General syntax for who
command:
$ who [OPTIONS...]
Show all users’ information
who -a
The -a
option allows you to see all the details of each user logged into the current system.
Example: Entering the who -a
command and getting the output of all the information about the users on the system

Show system’s last boot time
who -b
Use the who
command with the -b
option to print the last boot time of the system.
Example: After using the command, the output will print the message “system boot,” next to which the date and time are displayed.

List all logged in users
who -q
The -q
option displays a list of usernames and the number of users currently logged on to the system.
Example: Entering the command and see the users logged in and their current number

Check user’s write permission
who -T
Use the -T
option to display the user’s post status. This will help you check the permissions to write messages to the terminal.
Example: Let’s type the who -T
command to display user statuses in the terminal.

Show all dead processes
who -d
This command allows you to get a complete list of all dead processes.
Example: Typing the who
command with the -d
option to show details of all dead processes. Note: No dead processes in this case.

Show information about current user
who -m
The -m
option displays the hostname and user associated with I/O devices such as keyboards.
Example: Let’s run the who -m
command to see how this command works.

Show all active processes spawned by INIT process
who -p
Use the -p
option to show a list of active processes spawned by init (background process which starts other processes).
Example: Entering the command with the -p
option to get a list of processes. Note: No active processes in this case.

Show current runlevel
who -r
To display the current runlevel of the system, use the -r
option.
Example: Executing the who -r
command to get information about the system runlevel
