功能:显示最近的登录记录。
原理:last 搜索 /var/log/wtmp 文件;lastb 搜索 /var/log/btmp 文件。
用法:
-num This is a count telling last how many lines to show.
-n num The same.
-t YYYYMMDDHHMMSS
Display the state of logins as of the specified time.
-f file Specifies a file to search other than /var/log/wtmp
-R Suppresses the display of the hostname field.
-a Display the hostname in the last column. Useful in combination with the next flag.
-d For non-local logins, Linux stores not only the host name of the remote host but its IP number as well. This option translates the IP number back into a hostname.
The file wtmp and btmp might not be found. The system only logs information in these files if they are present. This is a local configuration issue. If you want the files to be used, they can be created with a simple touch(1) command.
阅读(527) | 评论(0) | 转发(0) |