In this article, we would cover how to check boot history of Ubuntu. There could be various reasons which would make you check your boot history of Ubuntu. It could be a technical issue or you are just preparing a report. Apart from that, you may want to personally manage the time your machine stay turned on. The reason could be anything. We can easily check for data through command – journalctl.
boot history of Ubuntu
With journalctl command-line utility, we can have previous 30 days data. It is used to view systemd logs. So, open a terminal and issue the following code –
–list-boots option is to list previous boot times.
The output may resemble –
0 55f50cf7fr6gd46fa85bb9970856978n Sat 2022-07-02 14:36:28 GMT—Sat 2022-07-02 18:38:11 GMT
It clearly shows us the machine’s first boot on a particular day with date and time. The subsequent entries show when the machine was turned off. We have shown here just one entry but, there would be past 30 days of data.
First field here shows the latest boot i.e. 0. Boot before the latest one is marked as -1 and so on. Second field is the Boot ID. Thereafter, the timestamps shows the On and Off times of the machine. The first timestamp shows the time when machine was turned ON. And, the subsequent one for when it was turned OFF.
If you like to know more about a specific boot ID then, use the following code –
journalctl -b <boot_ID>
journalctl -b 55f50cf7fr6gd46fa85bb9970856978n
In conclusion, we have covered how to check for boot history of Ubuntu.
Additional Info –
If you want to know about the current session. Then use uptime command-line utility. Through uptime, we can know – for how long our system has been up and running? Just issue the following code in the terminal –
It would return with something like –
up 10 hours, 34 minutes
-p is to show data in a pretty format. We would discuss more about uptime in coming articles.
But, the data we extract from uptime is only for the current session. For past data, we need to stay with