You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

lastlog
===
显示系统中所有用户最近一次登录信息
## 说明
**lastlog命令** 用于显示系统中所有用户最近一次登录信息
lastlog文件在每次有用户登录时被查询。可以使用lastlog命令检查某特定用户上次登录的时间并格式化输出上次登录日志`/var/log/lastlog`的内容。它根据UID排序显示登录名、端口号tty和上次登录时间。如果一个用户从未登录过lastlog显示` **Never logged** `。注意需要以root身份运行该命令
## 选项
```
lastlog(选项)
```
```
-b<天数>:显示指定天数前的登录信息
-h显示召集令的帮助信息
-t<天数>:显示指定天数以来的登录信息
-u<用户名>:显示指定用户的最近登录信息
```
## 实例
```
lastlog
Username Port From Latest
root pts/0 221.6.45.34 Tue Dec 17 09:40:48 +0800 2013
bin **Never logged in**
daemon **Never logged in**
adm **Never logged in**
lp **Never logged in**
sync **Never logged in**
shutdown **Never logged in**
halt **Never logged in**
mail **Never logged in**
news **Never logged in**
uucp **Never logged in**
operator **Never logged in**
games **Never logged in**
gopher **Never logged in**
ftp **Never logged in**
nobody **Never logged in**
vcsa **Never logged in**
ntp **Never logged in**
sshd **Never logged in**
nscd **Never logged in**
ldap **Never logged in**
postfix **Never logged in**
www **Never logged in**
mysql **Never logged in**
```