查看用户登录信息
[root@VM-24-17-centos ~]# whoami #查看当前终端的用户身份
root
[root@VM-24-17-centos ~]# su test
[test@VM-24-17-centos root]$ whoami #切换用户后再次查询
test
[root@VM-24-17-centos ~]# who #查看当前有哪些用户登录了系统
root pts/0 2022-03-28 09:28 (101.204.216.57)
[root@VM-24-17-centos ~]# w #查看当前登录系统的用户在执行什么操作
09:35:28 up 26 days, 12:35, 1 user, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 101.204.216.57 09:28 0.00s 0.01s 0.00s w

浙公网安备 33010602011771号