linux last login

linux last login

lastlog -u $USER | perl -lane 'END{print "Last login: @F[3..6] $F[8] from $F[2]"}'

Source: unix.stackexchange.com