http://www./blog/wszzdanm/article/p-6145895.html 命令功能:顯示登錄用戶的信息 命令格式: 常用選項(xiàng): 舉例: w 顯示已經(jīng)登錄的用戶及正在進(jìn)行的操作 [root@localhost ~]# w 11:22:01 up 4 days, 21:22, 3 users, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 - Thu14 4days 0.19s 0.19s -bash root pts/0 172.31.3.32 Thu14 0.00s 0.73s 0.00s w root pts/1 172.31.3.32 11:18 1:50 0.07s 0.02s -bash
who 顯示已經(jīng)登錄的用戶名,、終端名稱、登錄時(shí)間及登錄IP [root@localhost ~]# who root tty1 2015-11-12 14:00 root pts/0 2015-11-12 14:03 (172.31.3.32) root pts/1 2015-11-17 11:18 (172.31.3.32)
whoami 顯示當(dāng)前用戶的用戶名 [zzd@localhost ~]$ whoami zzd
who am i 顯示登錄系統(tǒng)的時(shí)候的用戶名,,即使已經(jīng)切換到其他用戶也顯示登錄時(shí)的用戶 結(jié)果同who -m [zzd@localhost ~]$ whoami zzd [zzd@localhost ~]$ who am i root pts/1 2015-11-17 11:18 (172.31.3.32) [zzd@localhost ~]$ who -m root pts/1 2015-11-17 11:18 (172.31.3.32) |
|
來(lái)自: 崔鋒1v14jbrb4q > 《LIUNX命令詳解》