The Linux who command is used to display which users are on the system, the displayed information includes the user ID, terminal used, connection from which side, online time, idle time, CPU usage, and action.
Permission: all users can use it.
Syntax
Who-[husfV] [user]
Parameter description:
- -H: do not display title columns
- -U: do not display user actions/work
- -S: Display in short format
- -F: do not display the user's online location
- -V: displays the program version.
Instance
Displays the users currently logged on to the system.
# Who // displays the users currently logged on to the system
Root tty7 (: 0)
Root pts/0 (: 0.0)
Root pts/1 (192.168.1.17)
Root pts/2 (192.168.1.17)
Display title bar
# Who-H
NAME LINE TIME COMMENT
Root tty7 (: 0)
Root pts/0 (: 0.0)
Root pts/1 (192.168.1.17)
Root pts/2 (192.168.1.17)
Show user logon sources
# Who-l-H
NAME LINE TIME IDLE PID COMMENT
LOGIN tty4 852 id = 4
LOGIN tty5 855 id = 5
LOGIN tty2 862 id = 2
LOGIN tty3 864 id = 3
LOGIN tty6 867 id = 6
LOGIN tty1 1021 id = 1
Display Terminal Properties
# Who-T-H
NAME LINE TIME COMMENT
Root + tty7 (: 0)
Root + pts/0 (: 0.0)
Root-pts/1 (192.168.1.17)
Root-pts/2 (192.168.1.17)
Show only the current user
# Who-m-H
NAME LINE TIME COMMENT
Root pts/1 (192.168.1.17)
Show in simplified mode
# Who-q
Root
# Users = 4