How Linux looks at the last reboot time

  
                

For Linux users, it is not going to pay attention to the last reboot time of the system, unless it is a Linux engineer. If you want to check the last reboot time of Linux, Xiaobian teaches you three ways to check the system restart time. .

Method a: last command

# last reboot

reboot system boot 2.6.32-431.el6.i Wed Jul 30 13:44 - 21: 39 (46+07:55)

reboot system boot 2.6.32-431.el6.i Sun Apr 13 14:28 - 09:27 (107+18:59)

reboot System boot 2.6.32-431.el6.i Tue Mar 25 22:27 - 14:19 (18+15:52)

This command actually shows the system runtime in the last few days. Last was originally designed to display the login history of a particular user. In Linux, there is a special "pseudo-user" called "reboot" that automatically logs in immediately when the system is restarted. This way you can check the last reboot time by checking the login history of the reboot user.

Method 2: who -b

Use the who command to bring the ‘-b’ option.

#谁 -b

system boot Jul 30 13:44

Method 3: uptime command

You can also use the uptime command to infer the end of the system. Start time. The uptime command will display the current time and also the time the system has been running. From this information, you can calculate the time when the system was last started

# uptime

21:46:31 up 46 days, 8:02, 1 user, load average: 0.04, 0.05, 0.01

The above is the way to view the last reboot time of the Linux system. There are three ways to use the last command, the uptime command, and the who-b to view it. Do you understand?

Copyright © Windows knowledge All Rights Reserved