Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using the who command, I can find which users are currently logged into a machine.

I would like to determine which users have logged into my machine in the past, and the length of those sessions. Is this information retained, and can I access it?

The particular machine I'm thinking of is running Ubuntu 10.10.

share|improve this question
up vote 10 down vote accepted

You can use the last command for this. It will tell you who logged in, what port/tty, date, time and duration of the session.

Here is the man page

FWIW, every installation of Ubuntu I've had, had this command available.

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.