How to find reboot time in Ubuntu 20.04 LTS? [CLI]

Hello folks, in this article, we will be discussing how to find reboot time for Ubuntu. Like other operating systems, Linux also maintains a log of everything including login time, reboot time, etc which is stored in the /var/log/wtmp file. Finding reboot time in Ubuntu can be done using commands like last, uptime, who. All of them can be us

Finding Reboot time using last command

The last command shows a list of all the users logged in since the file /var/log/wtmp is created along with the exact date and time. To use the last command, Open a terminal by pressing Ctrl+Alt+T and execute the following command:

last
find-reboot-time-1

To see a list of all the last reboots, enter the following command,

last reboot
find-reboot-time-2

To see only the last reboot time, enter the following command,

last reboot | head -1

Replace the number -1 with the number of last reboots you want to see.

find-reboot-time-3

To see the bad login attempts which are stored in the /var/log/btmp file, enter the following command,

lastb
find-reboot-time-4

Here, in the above image, there are no bad login attempts so it is showing when the file was created.

Finding Reboot time using the who command

The who command shows a list of users who are currently logged in. Enter the following command to know the users who are currently logged in:

who
find-reboot-time-who-cmd-1

To see all the details like time, active processes, dead processes, runlevel, etc, run the following command:

who -all

or

who -a
find-reboot-time-who-cmd-2

To see only the reboot time, enter the following command:

who -b
find-reboot-time-who-cmd-3

Find Reboot Time Using the Uptime Command

The uptime command shows the current time, how long the system has been running, how many users are logged in, and the load average. Enter the following command to know the uptime:

uptime
find-reboot-time-who-cmd-uptime-1

To know the last reboot time, enter the following command:

uptime -s
find-reboot-time-who-cmd-uptime-2

Conclusion

So, We discussed how to find reboot time in Ubuntu using these three commands. I hope it works for you. Thank you for reading!