Three ways to query the last restart time of a Linux system

Source: Internet
Author: User

For engineers in the Linux platform development or operations, often need to query the system last restart time, this article will give you three ways to introduce:

Method one: 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 operating time of the system in the last few days. Last was originally designed to show the login history of a particular user. In Linux, there is a special "pseudo-user" called Reboot that will automatically log in as soon as the system restarts. This allows you to check the last restart time by checking the login history of the reboot user.

Method Two: Who-b

Use the WHO command with ‘-b ' option.

# Who-bsystem Boot Jul 30 13:44

Method Three: Uptime command

You can also use the uptime command to infer the last boot time of the system. The uptime command displays the current time and also shows how long the system has been running. From this information, you can calculate the last time the system was started.

# uptime21:46:31 up, 8:02, 1 user, load average:0.04, 0.05, 0.01

  • This article is from: Linux Tutorial Network

Three ways to query the last restart time of a Linux system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.