One interesting command is called last – to see who logged in last.
[root@centos ~]# last
root pts/3 peregrin.lan Wed Feb 6 19:21 still logged in
knutt pts/1 :0.0 Wed Feb 6 19:12 still logged in
knutt pts/2 :0.0 Wed Feb 6 16:29 still logged in
knutt pts/1 :0.0 Wed Feb 6 16:28 - 19:12 (02:43)
knutt :0 Wed Feb 6 16:27 still logged in
root tty2 Wed Feb 6 16:14 still logged in
root tty1 Wed Feb 6 15:54 still logged in
reboot system boot 2.6.18-53.1.6.el Wed Feb 6 15:51 (03:29)
root tty1 Wed Feb 6 06:44 - crash (09:07)
last with no arguments gives you a log list of the last entries. last username tells you when that particular user logged in the last time – and a side effect here is the fact that since there is a pseudo user called reboot that logs in just before your system goes down, you can also write last reboot and get a comprehensive listing of when you rebooted. FreeBSD use a similar command with a slightly different output.
No Comments