1.命令w的功能最全面,能显示用户登录名、终端标志、星期几登录和具体登录时间、闲置时间、用户正在执行的程序、占用CPU时间、系统的运行时间和平均负载,例如:
[francis@localhost ~]$ w
10:29:43 up 1:07, 4 users, load average: 1.35, 0.78, 0.42
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
francis :0 09:22 ?xdm? 22:58 0.07s /bin/sh /usr/bin/startkde
francis pts/0 09:22 1:07m 0.03s 0.03s /bin/bash
francis pts/1 09:22 1:06m 0.00s 0.76s kdeinit4: kded4 [kdeinit]
francis pts/2 10:29 0.00s 0.03s 0.00s w
2.命令who的功能较简单,仅显示用户登录名、终端标志、和登录日期和时间,例如:
[francis@localhost ~]$ who
francis :0 2010-04-19 09:22
francis pts/0 2010-04-19 09:22
francis pts/1 2010-04-19 09:22
francis pts/2 2010-04-19 10:29
3.命名who am i 最简单,仅显示当前用户正使用的终端和登录时间,例如:
[francis@localhost ~]$ who am i
francis pts/2 2010-04-19 10:29
[francis@localhost ~]$ w
10:29:43 up 1:07, 4 users, load average: 1.35, 0.78, 0.42
USER TTY LOGIN@ IDLE JCPU PCPU WHAT
francis :0 09:22 ?xdm? 22:58 0.07s /bin/sh /usr/bin/startkde
francis pts/0 09:22 1:07m 0.03s 0.03s /bin/bash
francis pts/1 09:22 1:06m 0.00s 0.76s kdeinit4: kded4 [kdeinit]
francis pts/2 10:29 0.00s 0.03s 0.00s w
2.命令who的功能较简单,仅显示用户登录名、终端标志、和登录日期和时间,例如:
[francis@localhost ~]$ who
francis :0 2010-04-19 09:22
francis pts/0 2010-04-19 09:22
francis pts/1 2010-04-19 09:22
francis pts/2 2010-04-19 10:29
3.命名who am i 最简单,仅显示当前用户正使用的终端和登录时间,例如:
[francis@localhost ~]$ who am i
francis pts/2 2010-04-19 10:29
如果多个终端上登录的同一个用户名,可以用第3种方法查看!