Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

I'm a Rails developer working on a web application on Ubuntu Server 10.04. Due to internal requirements, I was asked to find the last 10 system boot and shutdown times... I have no clue where to find these details. Could someone help me out?

share|improve this question

Use the last command.

last -x | grep shutdown
last -x | grep reboot

You can pipe this to the head to read the last n instances. For example, in your case:

last -x | grep shutdown | head -n 10

You also should set


in the '/etc/default/bootlogd' file (it could be No by default).

share|improve this answer
great answer, I add | tail -10 – enzotib Apr 26 '11 at 19:05

Your Answer


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.