Powered by Blogger.

How to find out when the Linux box was last rebooted?

The question – I need to find out when my Linux machine was last rebooted. Is there a command that can be used to find this out?

There is a command called last which can be used to find this information:
[root@server ~]# last reboot
reboot   system boot  2.6.18-274.7.1.e Fri Sep 13 18:22 - 13:06 (27+18:44)
reboot   system boot  2.6.18-274.7.1.e Wed May 22 19:34 - 18:21 (113+22:46)
reboot   system boot  2.6.18-274.7.1.e Mon Feb  4 19:37 - 18:21 (220+21:44)
reboot   system boot  2.6.18-274.7.1.e Mon Feb  4 19:36 - 19:36  (00:00)

wtmp begins Mon Feb  4 19:36:32 2013
[root@server ~]#
The last command shows information about users and not the system. However, there is a pseudo user called reboot which logs in every time a Linux machine is rebooted. So asking last for the user called reboot will show you a complete list of times at which the system was rebooted!
There is another command called who which can be used to find the same information:
[root@server ~]# who --boot
         system boot  2013-09-13 18:22
[root@server ~]#
    Blogger Comment
    Facebook Comment