1, w command to view the current user
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2017_04/170421183587693.png "width=" 705 "vspace=" 5 "style = "border:0px;"/>
[Email protected]/]#W
04:31:52 up 1:45, 2 users, load average:0.00, 0.01, 0.05
USER TTY from [email protected] IDLE jcpu PCPU
Root tty1 02:46 1:45m 0.02s 0.02s-bash
root pts/0 192.168.146.1 03:19 0.00s 0.10s 0.02s w
The first line is: Current time, from boot to now how long, load balancing
The second line is: Description of each column
The third line is: root User login information
2. Who command to view the users on the host
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2017_04/170421183587694.png "width=" 705 "vspace=" 5 "style = "border:0px;"/>
[email protected]/]# who
Root Tty1 2017-04-19 02:46
Root pts/0 2017-04-19 03:19 (192.168.146.1)
"Attached": see who is currently logged on user
WhoAmI (no spaces between letters)
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2017_04/170421183587692.png "style=" border:0px; "/>
3.lastlog command to view the users on the host
650) this.width=650; "src=" Http://www.linuxidc.com/upload/2017_04/170421183587691.png "width=" 705 "vspace=" 5 "style = "border:0px;"/>
[Email protected]/]# Lastlog | Head-n 15
Username Port from Latest
Root pts/0 192.168.146.1 Wed Apr 19 03:19:47-0400 2017
Bin **never Logged in**
Daemon **never logged in**
ADM **never logged in**
LP **never logged in**
Sync **never logged in**
Summary of commands for querying the current user in Linux