|
参数 |
长参数 | 描叙 |
| -a | 将登录系统的的主机名称或IP地址,显示在最后一行 | |
| -d | 将IP地址转换成主机名称 | |
| -f | 指定记录文件,默认是显示/var/log目录下的wtmp文件的记录,但/var/log目录下得btmp能显示的内容更丰富,可以显示远程登录,例如ssh登录 ,包括失败的登录请求。 | |
| -i | -i显示特定ip登录的情况。跟踪用 -i显示特定ip登录的情况。跟踪用 | |
| -o | Read an old-type wtmp file (written by linux-libc5 applications). | |
| -n | -n <显示行数>或-<显示行数> 设置显示多少行记录 | |
| -w | Display full user and domain names in the output | |
| -R | 不显示登入系统的主机名称或IP(省略 hostname 的栏位) | |
| -t | 显示YYYYMMDDHHMMSS之前的信息 | |
| -x | 显示系统关闭、用户登录和退出的历史 |
[root@DB-Server ~]# man last [root@DB-Server ~]# last -h last: invalid option -- h Usage: last [-num | -n num] [-f file] [-t YYYYMMDDHHMMSS] [-R] [-x] [-o] [-w] [username..] [tty..]
[root@DB-Server ~]#last -10 root pts/1 :0.0 Wed Dec 18 09:54 still logged in root pts/4 :0.0 Wed Dec 18 09:43 - 09:48 (00:04) root pts/1 :0.0 Wed Dec 18 09:43 - 09:48 (00:05) root pts/3 192.168.103.79 Wed Dec 18 09:41 - 12:40 (02:59) root pts/4 :0.0 Wed Dec 18 09:28 - 09:30 (00:01) root pts/3 :0.0 Wed Dec 18 09:27 - 09:30 (00:02) root pts/2 192.168.103.29 Wed Dec 18 09:27 still logged in root pts/1 :0.0 Wed Dec 18 09:27 - 09:42 (00:15) root pts/2 :0.0 Wed Dec 18 09:23 - 09:25 (00:01) root pts/1 :0.0 Wed Dec 18 09:22 - 09:25 (00:02) wtmp begins Wed Dec 11 03:02:17 2013 [root@DB-Server ~]# last -n 10 root pts/1 :0.0 Wed Dec 18 09:54 still logged in root pts/4 :0.0 Wed Dec 18 09:43 - 09:48 (00:04) root pts/1 :0.0 Wed Dec 18 09:43 - 09:48 (00:05) root pts/3 192.168.103.79 Wed Dec 18 09:41 - 12:40 (02:59) root pts/4 :0.0 Wed Dec 18 09:28 - 09:30 (00:01) root pts/3 :0.0 Wed Dec 18 09:27 - 09:30 (00:02) root pts/2 192.168.103.29 Wed Dec 18 09:27 still logged in root pts/1 :0.0 Wed Dec 18 09:27 - 09:42 (00:15) root pts/2 :0.0 Wed Dec 18 09:23 - 09:25 (00:01) root pts/1 :0.0 Wed Dec 18 09:22 - 09:25 (00:02) wtmp begins Wed Dec 11 03:02:17 2013
[root@DB-Server ~]# last -10 -a root pts/1 Wed Dec 18 09:54 still logged in :0.0 root pts/4 Wed Dec 18 09:43 - 09:48 (00:04) :0.0 root pts/1 Wed Dec 18 09:43 - 09:48 (00:05) :0.0 root pts/3 Wed Dec 18 09:41 - 12:40 (02:59) 192.168.103.79 root pts/4 Wed Dec 18 09:28 - 09:30 (00:01) :0.0 root pts/3 Wed Dec 18 09:27 - 09:30 (00:02) :0.0 root pts/2 Wed Dec 18 09:27 still logged in 192.168.103.29 root pts/1 Wed Dec 18 09:27 - 09:42 (00:15) :0.0 root pts/2 Wed Dec 18 09:23 - 09:25 (00:01) :0.0 root pts/1 Wed Dec 18 09:22 - 09:25 (00:02) :0.0 wtmp begins Wed Dec 11 03:02:17 2013
[root@DB-Server ~]# last -10 -R root pts/1 Wed Dec 18 09:54 still logged in root pts/4 Wed Dec 18 09:43 - 09:48 (00:04) root pts/1 Wed Dec 18 09:43 - 09:48 (00:05) root pts/3 Wed Dec 18 09:41 - 12:40 (02:59) root pts/4 Wed Dec 18 09:28 - 09:30 (00:01) root pts/3 Wed Dec 18 09:27 - 09:30 (00:02) root pts/2 Wed Dec 18 09:27 still logged in root pts/1 Wed Dec 18 09:27 - 09:42 (00:15) root pts/2 Wed Dec 18 09:23 - 09:25 (00:01) root pts/1 Wed Dec 18 09:22 - 09:25 (00:02) wtmp begins Wed Dec 11 03:02:17 2013
[root@DB-Server ~]# 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
last -10 -d
[root@DB-Server ~]# 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
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有