Skip to main content

View the last logged in users.

# To view last logins, their duration  and other information as read from /var/log/wtmp:
last

# To specify how many of the last logins to show:
last -n <login_count>

# To print the full date and time for entries and then display the hostname column last to prevent truncation:
last -F -a

# To view all logins by a specific user and show the ip address instead of the hostname:
last <user_name> -i

# To view all recorded reboots (i.e., the last logins of the pseudo user "reboot"):
last reboot

# To view all recorded shutdowns (i.e., the last logins of the pseudo user "shutdown"):
last shutdown