Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

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.

share|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

Try with last. See man last for the options.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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