Home Linux Commands How to Find Ubuntu System Reboot Date and Time

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!

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.