How to Find Ubuntu System Reboot Date and Time

Every operating system, whether being used as a personal computer or as a server, maintains a log of the shutdown, reboot, and login times. This is not only important for system administration, but also for troubleshooting problems.

In Linux, all logs are stored in the ‘/var/log/’ directory. The details about logged-in users and respective shutdown, reboot, and login times are also stored here.

Let’s see how we can find out the last reboot time in Ubuntu.

Using Last Command

We can run the command last with the parameter ‘reboot’ to get the time and date of the last reboot.

$ last reboot
Check Ubuntu Last Reboot Time
Check Ubuntu Last Reboot Time

As seen above, the list of last reboots is displayed. To just display the latest reboot, filter the output with the ‘head‘ command.

$ last reboot | head -1
Find Last Reboot Time of Ubuntu
Find Last Reboot Time of Ubuntu

We thus know that the Ubuntu system was last rebooted on Wednesday, Jan 6th at 14:37.

Using Who Command

The who command in Linux displays information about the logged-in user.

$ who
Find Currently Logged in Users
Find Currently Logged in Users

As shown above, it displays the logged in user name, the ID (:0), the login time, and the remote or local display ID (:0).

If we execute this command with the '-b' flag, it displays the time and date of the last reboot.

$ who -b
Find Last System Reboot Time
Find Last System Reboot Time

Using Uptime Command

The uptime command displays the uptime of the system, i.e., how long has the system been running. It outputs in the length of time the system has been running.

$ uptime
Check Ubuntu Uptime
Check Ubuntu Uptime

We can pass the argument '-s' to output the last time the system was booted.

$ uptime -s
Show Last System Reboot Time
Show Last System Reboot Time

User can also pass an argument '--since' which gives the same result as '-s'.

Conclusion

In this article, we looked at the ways of finding the last reboot time in Ubuntu. Apart from simply viewing the time, an advanced user/administrator can also make use of the output of the above commands in a script.

If you have any questions or feedback, make sure you leave a comment below!

Got something to say? Join the discussion.