看/proc/uptime。第一个值是开机之后过去的秒数。第二个值是所有核的idle的时间之和。
/proc/uptime
来源:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-proc-uptime