[root@linuxidc ~]# last -n 10 -f /var/log/btmp
root ssh:notty 192.168.136.163 Fri Oct 17 18:16 gone - no logout
root ssh:notty 192.168.136.163 Fri Oct 17 09:50 - 18:16 (08:26)
root ssh:notty 192.168.136.163 Fri Oct 17 09:50 - 09:50 (00:00)
root ssh:notty 192.168.40.218 Tue Jul 23 17:40 - 09:50 (450+16:10)
root ssh:notty 192.168.236.149 Sun Apr 14 01:34 - 17:40 (100+16:05)
root ssh:notty 192.168.178.147 Fri Mar 8 17:25 - 01:34 (36+08:08)
tomcat ssh:notty get185806.gfg1.e Fri Oct 26 16:48 - 17:25 (133+00:37)
root ssh:notty 192.168.193.3 Mon Oct 22 18:13 - 16:48 (3+22:34)
root ssh:notty 192.168.193.3 Mon Oct 22 18:13 - 18:13 (00:00)
devloper ssh:notty get185819.gfg1.e Wed Oct 17 17:22 - 18:13 (5+00:50)
btmp begins Thu Apr 12 14:30:06 2012
6: 将IP地址转换成主机名称
last -10 -d
clip_image001
7: 显示YYYYMMDDHHMMSS(20150110093000)之前的信息
[root@linuxidc ~]# last -10 -t 20150110093000
root pts/2 192.168.102.186 Fri Jan 9 15:35 - 17:27 (01:52)
root pts/2 192.168.102.134 Thu Jan 8 10:25 - 12:27 (02:02)
root pts/3 192.168.125.53 Tue Jan 6 23:59 - 00:09 (00:09)
root pts/2 192.168.125.53 Tue Jan 6 23:45 - 00:09 (00:23)
root pts/3 192.168.102.88 Tue Jan 6 15:23 - 16:20 (00:57)
root pts/2 192.168.102.88 Tue Jan 6 15:08 - 17:25 (02:16)
Oracle pts/1 :2.0 Tue Jan 6 15:07 still logged in
reboot system boot 2.6.32-200.13.1. Tue Jan 6 15:07 (7+20:21)
root pts/2 192.168.102.88 Tue Jan 6 14:47 - down (00:17)
oracle pts/1 :2.0 Tue Jan 6 14:46 - down (00:18)
wtmp begins Wed Apr 11 16:31:10 2012