The who command is used to display the information of all users currently logged in to the system. You can view the information of those users currently logged in to the system. When executing the who command alone, you can print out the login account, the terminal used by the user, the login time, where to log in or which monitors you are using.
who [ OPTION ]... [ FILE ] [ am i ]
-a # Same as using option - B - D -- login - P - R - t - U. -b # Displays the last time the system booted -d # Show invalid processes -H # Displays the title information column of each field -i # Show idle time -m # This parameter and specifies "am" I "same as string -q # Only the account name and total number of people logged in to the system are displayed -w # Displays the user's information status bar --help # Print online help --version # display version information
[[email protected] ~]# who root pts/0 2021-01-17 08:26 (192.168.1.93) root pts/1 2021-01-17 08:32 (192.168.1.93) [[email protected] ~]# who -b system boot 2021-01-14 05:41 [[email protected] ~]# who -d [[email protected] ~]# who -m root pts/1 2021-01-17 08:32 (192.168.1.93) [[email protected] ~]# who -q root root # users=2 [[email protected] ~]# who -aH NAME LINE TIME IDLE PID COMMENT EXIT system boot 2021-01-14 05:41 LOGIN tty1 2021-01-14 05:42 630 id=tty1 run-level 3 2021-01-14 05:42 root + pts/0 2021-01-17 08:26 00:06 28432 (192.168.1.93) root + pts/1 2021-01-17 08:32 . 28737 (192.168.1.93)