这篇文章主要介绍了Linux的lastlog命令如何使用的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇Linux的lastlog命令如何使用文章都会有所收获,下面我们一起来看看吧。
用法:lastlog [选项]
选项:
-b, --before DAYS 仅打印早于 DAYS 的最近登录记录
-C, --clear clear lastlog record of an user (usable only with -u)
-h, --help 显示此帮助信息并推出
-R, --root CHROOT_DIR chroot 到的目录
-S, --set set lastlog record to current time (usable only with -u)
-t, --time DAYS 仅打印晚于 DAYS 的最近登录记录
-u, --user LOGIN 打印 LOGIN 用户的最近登录记录
12345678
显示系统中所有用户最近一次登录信息
[root@itcast ~]# lastlog
显示指定天数前的登录信息
[root@itcast ~]# lastlog -b 7
显示指定天数以来的登录信
[root@itcast ~]# lastlog -t 7
用户名 端口 来自 最后登陆时间
root pts/0 六 8月 3 10:27:37 +0800 2019
deng pts/0 172.16.0.51 六 8月 3 10:27:30 +0800 2019
itcast pts/1 三 7月 31 21:25:50 +0800 2019
[root@itcast ~]#
显示指定用户的最近登录信息
[root@itcast ~]# lastlog -u root
用户名 端口 来自 最后登陆时间
root pts/0 六 8月 3 10:27:37 +0800 2019
[root@itcast ~]#
清除指定用户的登录信息
[root@itcast ~]# lastlog -C -u root
[root@itcast ~]#
[root@itcast ~]#
[root@itcast ~]# lastlog -u root
用户名 端口 来自 最后登陆时间
root **从未登录过**
[root@itcast ~]#
关于“Linux的lastlog命令如何使用”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“Linux的lastlog命令如何使用”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。