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
To see a list of all the last reboots, enter the following command,
last reboot
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.
To see the bad login attempts which are stored in the /var/log/btmp file, enter the following command,
lastb
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
To see all the details like time, active processes, dead processes, runlevel, etc, run the following command:
who -all
or
who -a
To see only the reboot time, enter the following command:
who -b
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
To know the last reboot time, enter the following command:
uptime -s
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!