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...]
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
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.
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
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.
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.
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.
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.
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
The post How to Use the Who Command in Linux appeared first on Hongkiat.
from Signage https://ift.tt/Vrxb7kc
via Irvine Sign Company