View the last Centos startup time and running time

Source: Internet
Author: User
1. uptime Command [SQL] viewplaincopy [spark @ MasterLog_Data] $ uptime09: 18: 01up20: 17 1. uptime Command [SQL]View plaincopy
  1. [Spark @ Master Log_Data] $ uptime
  2. 09:18:01 up, 1 user, load average: 0.13, 0.12, 0.14
  2. View/proc/uptime file calculation system startup time [SQL]View plaincopy
  1. [Spark @ Master Log_Data] $ cat/proc/uptime
  2. 73064.44 276161.85
Output: 73064.44 276161.85 the first digit is the system running time of 73064.44 seconds. The system startup time can be calculated using the system tool date. Code: [SQL]View plaincopy
  1. [Spark @ Master Log_Data] $ date-d "$ (awk-F. '{print $1}'/proc/uptime) second ago "+" % Y-% m-% d % H: % M: % S"
  2. 13:00:59
3. view the running time of the/proc/uptime file computing system.  Code: [SQL]View plaincopy
  1. [Spark @ Master Log_Data] $ cat/proc/uptime | awk-F. '{run_days = $1/86400; run_hour = ($ 1% 86400 3600)/1%; run_minute = ($3600 1%)/60; run_second = $60; printf ("The system has

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.