Files
tldr/pages.zh/common/last.md

28 lines
670 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# last
> 查看最后登录的用户。
> 更多信息: <https://manned.org/last>。
- 查看最后的登录情况、其持续时间以及从 `/var/log/wtmp` 读取的其他信息:
`last`
- 指定要显示的最后登录次数:
`last -n {{login_count}}`
- 打印条目的完整日期和时间,然后将主机名列最后显示以防止截断:
`last -F -a`
- 查看特定用户的所有登录记录并显示IP地址而不是主机名
`last {{username}} -i`
- 查看所有记录的重启即伪用户“reboot”的最后登录
`last reboot`
- 查看所有记录的关机即伪用户“shutdown”的最后登录
`last shutdown`