I want to see my previous logins when I login using the command line in Ubuntu 10 and I am wondering if there is a command to do it?

The command should show the last times/dates that I logged in.

link|improve this question

feedback

2 Answers

up vote 7 down vote accepted

The last command shows all previous and active logins. last $USER restricts to your user. last $USER | head -n 3 shows the latest 3.

The list of previous logins is reinitialized every month by default, and a copy of the previous month is kept (you can interrogate it with last -f /var/log/wtmp.1). This is controlled in /etc/logrotate.conf.

link|improve this answer
Thanks Gilles. I tested and it works on Mac OS X and Ubuntu. Cheers – Brock Woolf Aug 17 '10 at 16:01
feedback

Try with last. See man last for the options.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.