View System Boot time in Linux

Source: Internet
Author: User

Sometimes you need to check how long the Linux system has been running. At this time, you need to know the start time of the last boot. Sometimes, due to power failure or power supply failure, you need to check the Linux boot time/restart time; the following summarizes some methods for viewing the Linux boot shutdown time (very comprehensive)

1: who command to view

Who-B view the last system startup time.

Who-r: view the current system running time

[Root @ DB-Server ~] # Who-B

System boot May 11

2: last reboot

As shown in the following figure, you can see the Linux system historical start time in last reboot. After restarting the operating system

[Root @ DB-Server ~] # Last reboot

Reboot system boot 2.6.9-42. ELsmp Thu May 29)

Reboot system boot 2.6.9-42. ELsmp Sun May 11 (18 + 05: 55)

Wtmp begins Mon May 5 16:18:57 2014

If you only need to view the last Linux Startup time

[Root @ DB-Server ~] # Last reboot | head-1

Reboot system boot 2.6.9-42. ELsmp Thu May 29)

3: view TOP commands

As shown in the following figure, "up" indicates how long the system has been running. In turn, the system restart time is estimated.

4: view the w command

4: view the w command

As shown in the following figure, "up" indicates how long the system has been running. In turn, the system restart time is estimated.

5: view the uptime command

6: View/proc/uptime

[Root @ DB-Server ~] # Cat/proc/uptime

1415.59 1401.42

[Root @ DB-Server ~] # Date-d "'cut-f1-d./proc/uptime 'Seconds ago"

Thu May 29 15:24:57 CST 2014

[Root @ DB-Server ~] # Date-d "$ (awk-F. '{print $1}'/proc/uptime) second ago "+" % Y-% m-% d % H: % M: % S"
15:24:57

 

References:

Http://www.thegeekstuff.com/2011/10/linux-reboot-date-and-time/

Http://www.averainy.info/linux-system-operation-time-and-the-view-of-the-latest-powered-up-time/

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.