Last User to Login Locally or Online?

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>

๐Ÿ‘ Get Blog Updates

๐Ÿ“ Latest Posts


Leave a Reply