2016-01-02 01:09:44 +00:00
|
|
|
# last
|
2015-12-30 22:46:40 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> View the last logged in users.
|
2015-12-30 22:46:40 +00:00
|
|
|
|
2019-02-24 15:47:41 +00:00
|
|
|
- View last logins, their duration and other information as read from /var/log/wtmp:
|
2015-12-30 22:46:40 +00:00
|
|
|
|
|
|
|
`last`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Specify how many of the last logins to show:
|
2015-12-30 22:46:40 +00:00
|
|
|
|
|
|
|
`last -n {{login_count}}`
|
|
|
|
|
2017-10-17 07:30:41 +01:00
|
|
|
- Print the full date and time for entries and then display the hostname column last to prevent truncation:
|
2015-12-30 22:46:40 +00:00
|
|
|
|
2017-10-17 07:30:41 +01:00
|
|
|
`last -F -a`
|
2015-12-30 22:46:40 +00:00
|
|
|
|
2017-10-17 07:30:41 +01:00
|
|
|
- View all logins by a specific user and show the ip address instead of the hostname:
|
2015-12-30 22:46:40 +00:00
|
|
|
|
2017-10-17 07:30:41 +01:00
|
|
|
`last {{user_name}} -i`
|
2015-12-30 22:46:40 +00:00
|
|
|
|
2017-10-17 07:30:41 +01:00
|
|
|
- View all recorded reboots (i.e., the last logins of the pseudo user "reboot"):
|
2015-12-30 22:46:40 +00:00
|
|
|
|
|
|
|
`last reboot`
|
|
|
|
|
2017-10-17 07:30:41 +01:00
|
|
|
- View all recorded shutdowns (i.e., the last logins of the pseudo user "shutdown"):
|
2015-12-30 22:46:40 +00:00
|
|
|
|
|
|
|
`last shutdown`
|