Linux getting started Tutorial: how to check the last restart time of the Linux System
Q: Is there a command to quickly check how long the system has been running? That is, how do I know the last restart time of the Linux system?
There are many ways to query the last restart time.
Method 1
The first method is to use the last command.
- $ Last reboot
This command actually shows the system running time in the last few days. Last was originally designed to display the logon history of a specific user. In Linux, a special "pseudo-user" called reboot will automatically log on to the system upon system restart. By checking the logon history of the reboot user, you can check the last restart time.
Method 2
Another method for detecting the last startup time of the system is to use the '-B' option with the who command.
- $ Who-B
Method 3
You can also use the uptime command to infer the last startup time of the system. The uptime command displays the current time and the system running time. From this information, you can calculate the last startup time of the system.
- $ Uptime
This article permanently updates the link address: