2016-01-02 03:09:44 +02:00
|
|
|
# last
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> View the last logged in users.
|
2021-09-24 02:34:23 +08:00
|
|
|
> More information: <https://manned.org/last>.
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2025-03-22 08:37:12 +02:00
|
|
|
- View last login infromation (e.g., username, terminal, boot time, kernel) of all users as read from `/var/log/wtmp`:
|
2015-12-31 00:46:40 +02:00
|
|
|
|
|
|
|
`last`
|
|
|
|
|
2025-03-22 08:37:12 +02:00
|
|
|
- List login information of a specific user:
|
|
|
|
|
|
|
|
`last {{username}}`
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
- Specify how many of the last logins to show:
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2025-03-22 08:37:12 +02:00
|
|
|
`last {{[-n|--limit]}} {{login_count}}`
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2017-10-17 00:30:41 -06:00
|
|
|
- Print the full date and time for entries and then display the hostname column last to prevent truncation:
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2025-03-22 08:37:12 +02:00
|
|
|
`last {{[-F|--fulltimes]}} {{[-a|--hostlast]}}`
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2021-08-15 19:59:09 +02:00
|
|
|
- View all logins by a specific user and show the IP address instead of the hostname:
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2025-03-22 08:37:12 +02:00
|
|
|
`last {{username}} {{[-i|--ip]}}`
|
|
|
|
|
|
|
|
- List information since a specific time and date:
|
|
|
|
|
|
|
|
`last {{[-s|--since]}} {{-7days}}`
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2017-10-17 00:30:41 -06:00
|
|
|
- View all recorded reboots (i.e., the last logins of the pseudo user "reboot"):
|
2015-12-31 00:46:40 +02:00
|
|
|
|
|
|
|
`last reboot`
|
|
|
|
|
2025-03-22 08:37:12 +02:00
|
|
|
- Display help:
|
2015-12-31 00:46:40 +02:00
|
|
|
|
2025-03-22 08:37:12 +02:00
|
|
|
`last {{[-h|--help]}}`
|