一、作用
用于显示用户最近登录信息
二、选项
- -d 将IP地址转换成主机名称
三、实例
``` [root@localhost ~]# last -d -5 root pts/0 192.168.11.101 Fri Jun 17 16:44 still logged in
root pts/2 192.168.11.101 Fri Jun 17 15:27 - 15:27 (00:00)
root pts/1 gateway Fri Jun 17 15:09 still logged in
root pts/3 gateway Thu Jun 16 22:05 - 22:27 (00:21)
root pts/2 gateway Thu Jun 16 22:03 - 22:27 (00:23)
wtmp begins Sun Jun 5 07:00:59 2022 [root@localhost ~]#
```shell
[root@localhost ~]# last -5 -t 20220616000000
root pts/0 192.168.11.254 Sat Jun 11 03:47 gone - no logout
reboot system boot 3.10.0-1062.el7. Sat Jun 11 03:42 - 16:54 (6+13:12)
root pts/0 192.168.11.254 Sat Jun 11 03:36 - crash (00:05)
reboot system boot 3.10.0-1062.el7. Sat Jun 11 03:35 - 16:54 (6+13:19)
root pts/0 192.168.11.254 Fri Jun 10 19:30 - crash (08:04)
wtmp begins Sun Jun 5 07:00:59 2022