2022-03-16 894
Linux之last命令用法与介绍
Linux last 命令用于显示用户最近登录信息。
使用权限:所有使用者。
语法
shell>> last [options]
参数说明:
●-R 省略 hostname 的栏位
●-num 展示前 num 个
●username 展示 username 的登入讯息
●tty 限制登入讯息包含终端机代号
shell>> last -R -2 johnney pts/1 Mon Aug 14 20:42 still logged in johnney pts/0 Mon Aug 14 19:59 still logged in wtmp begins Tue Aug 1 09:01:10 2000 ### /var/log/wtmp shell>> last -2 minery minery pts/0 140.119.217.115 Mon Aug 14 18:37 - 18:40 (00:03) minery pts/0 140.119.217.115 Mon Aug 14 17:22 - 17:24 (00:02) wtmp begins Tue Aug 1 09:01:10 2000
一般显示方法
# last
简略显示,并指定显示的个数
# last -n 5 -R root pts/4 Thu May 13 17:25 still logged in root pts/2 Thu May 13 17:23 - 17:25 (00:02) root pts/1 Thu May 13 16:46 still logged in root pts/7 Thu May 13 15:36 still logged in root pts/9 Thu May 13 15:35 still logged in wtmp begins Thu May 13 18:55:40 2014
显示最后一列显示主机IP地址
# last -n 5 -a -i root pts/4 Thu May 13 17:25 still logged in 192.168.1.10 root pts/2 Thu May 13 17:23 - 17:25 (00:02) 192.168.1.10 root pts/1 Thu May 13 16:46 still logged in 192.168.1.10 root pts/7 Thu May 13 15:36 still logged in 192.168.1.10 root pts/9 Thu May 13 15:35 still logged in 192.168.1.10 wtmp begins Thu May 13 18:55:40 2014
原文链接:https://77isp.com/post/615.html
=========================================
https://77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。
数据库技术 2022-03-28
网站技术 2022-11-26
网站技术 2023-01-07
网站技术 2022-11-17
Windows相关 2022-02-23
网站技术 2023-01-14
Windows相关 2022-02-16
Windows相关 2022-02-16
Linux相关 2022-02-27
数据库技术 2022-02-20
抠敌 2023年10月23日
嚼餐 2023年10月23日
男忌 2023年10月22日
瓮仆 2023年10月22日
簿偌 2023年10月22日
扫码二维码
获取最新动态