[root@masterdata-app1 ~]# w
22:52:39 up 133 days, 16:47, 8 users, load average: 0.77, 0.31, 0.32
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 remotepc.cedarhd 22:08 32:22 0.07s 0.04s vi applicationContext.xml
root pts/2 10.3.244.3 22:47 0.00s 0.02s 0.00s w
root tty1 :0 28Apr18 133days 1:17 1:17 /usr/bin/Xorg :0 -br -verbose -audit 4 -auth /var/run/gdm/au
root pts/1 :0.0 28Apr18 16days 0.06s 0.06s /bin/bash
root pts/5 remotepc.cedarhd 20:00 7:27 0.15s 0.15s -bash
root pts/6 remotepc.cedarhd 21:01 60.00s 0.06s 0.06s -bash
root pts/7 remotepc.cedarhd 21:30 44.00s 1:32 0.02s -bash
root pts/8 remotepc.cedarhd 21:30 1:21m 0.10s 0.07s tail -500f catalina.out
[root@masterdata-app1 ~]# who
root pts/0 2018-05-14 22:08 (remotepc.cedarhd.com)
root pts/2 2018-05-14 22:47 (10.3.244.3)
root tty1 2018-04-28 15:22 (:0)
root pts/1 2018-04-28 15:22 (:0.0)
root pts/5 2018-05-14 20:00 (remotepc.cedarhd.com)
root pts/6 2018-05-14 21:01 (remotepc.cedarhd.com)
root pts/7 2018-05-14 21:30 (remotepc.cedarhd.com)
root pts/8 2018-05-14 21:30 (remotepc.cedarhd.com)
[root@masterdata-app1 ~]# who
root pts/0 2018-05-14 22:08 (remotepc.cedarhd.com)
root pts/2 2018-05-14 22:47 (10.3.244.3)
root tty1 2018-04-28 15:22 (:0)
root pts/1 2018-04-28 15:22 (:0.0)
root pts/5 2018-05-14 20:00 (remotepc.cedarhd.com)
root pts/6 2018-05-14 21:01 (remotepc.cedarhd.com)
root pts/7 2018-05-14 21:30 (remotepc.cedarhd.com)
root pts/8 2018-05-14 21:30 (remotepc.cedarhd.com)
[root@masterdata-app1 ~]# pkill -kill -t pts/2
[root@masterdata-app1 ~]# lastlog
Username Port From Latest
root pts/2 10.3.244.3 Mon May 14 22:47:03 +0800 2018
bin **Never logged in**
daemon **Never logged in**
adm **Never logged in**
lp **Never logged in**
sync **Never logged in**
shutdown **Never logged in**
halt **Never logged in**
mail **Never logged in**
uucp **Never logged in**
operator **Never logged in**
games **Never logged in**
原文地址:http://blog.51cto.com/12965094/2116348