Learn a Linux command every day (53): who

Time:2021-9-4

Learn a Linux command every day (53): who

Recommended yesterday: [](http://mp.weixin.qq.com/s?__b…Learn a Linux command every day (52): where is

Command introduction

The who command is used to display the user information currently logged in to the system.

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.

Syntax format

who [ OPTION ]... [ FILE ] [ am i ]

Option description

-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

Application examples

[[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)

Learn a Linux command every day (50): Date

Learn a Linux command every day (51): which