View the last Centos startup time and running time
1. uptime Command [SQL] view plaincopy
- [Spark @ MasterLog_Data] $ uptime
- 09: 18: 01up20: 17,1 user, loadaverage: 0.13, 0.12, 0.14
2. view the start time of the/proc/uptime file computing system [SQL] view plaincopy
- [Spark @ MasterLog_Data] $ cat/proc/uptime
- 73064.44276161.85
Output: 73064.44 276161.85 the first digit is the system running time of 73064.44 seconds. Use the system tool date to calculate the system startup time code: [SQL] view plaincopy
- [Spark @ MasterLog_Data] $ date-d "$ (awk-F. '{print $1}'/proc/uptime) secondago "+" % Y-% m-% d % H: % M: % S"
- 2015-12-02:00:59
3. view the running time code of the/proc/uptime file Computing System: [SQL] view plaincopy
- [Spark @ MasterLog_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