Last User to Login Locally or Online?

By | Command Line, Linux

The command last can be used to figure out who last logged in locally! Also, lastlog can used to see when the user logged in over the interwebs last.

last command

Show who is still logged in:

last | grep -i still

Example show the 4 last times logged in:

last -n 4 <username>

lastlog command

Show all users who last logged in:

lastlog | grep -v '\*\*Never'

When was the last time the logged in:

lastlog -u <username>

Leave a Reply

Your email address will not be published. Required fields are marked *