2016-01-02 04:09:44 +03:00
|
|
|
# last
|
2015-12-31 01:46:40 +03:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
> View the last logged in users.
|
2021-09-23 21:34:23 +03:00
|
|
|
> More information: <https://manned.org/last>.
|
2015-12-31 01:46:40 +03:00
|
|
|
|
2021-01-31 20:05:18 +03:00
|
|
|
- View last logins, their duration and other information as read from `/var/log/wtmp`:
|
2015-12-31 01:46:40 +03:00
|
|
|
|
|
|
|
`last`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Specify how many of the last logins to show:
|
2015-12-31 01:46:40 +03:00
|
|
|
|
|
|
|
`last -n {{login_count}}`
|
|
|
|
|
2017-10-17 09:30:41 +03:00
|
|
|
- Print the full date and time for entries and then display the hostname column last to prevent truncation:
|
2015-12-31 01:46:40 +03:00
|
|
|
|
2017-10-17 09:30:41 +03:00
|
|
|
`last -F -a`
|
2015-12-31 01:46:40 +03:00
|
|
|
|
2021-08-15 20:59:09 +03:00
|
|
|
- View all logins by a specific user and show the IP address instead of the hostname:
|
2015-12-31 01:46:40 +03:00
|
|
|
|
2020-02-08 21:56:05 +03:00
|
|
|
`last {{username}} -i`
|
2015-12-31 01:46:40 +03:00
|
|
|
|
2017-10-17 09:30:41 +03:00
|
|
|
- View all recorded reboots (i.e., the last logins of the pseudo user "reboot"):
|
2015-12-31 01:46:40 +03:00
|
|
|
|
|
|
|
`last reboot`
|
|
|
|
|
2017-10-17 09:30:41 +03:00
|
|
|
- View all recorded shutdowns (i.e., the last logins of the pseudo user "shutdown"):
|
2015-12-31 01:46:40 +03:00
|
|
|
|
|
|
|
`last shutdown`
|