700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > centos怎么启动linux系统时间 查看Centos系统最近一次启动时间和运行时间

centos怎么启动linux系统时间 查看Centos系统最近一次启动时间和运行时间

时间:2018-09-29 10:30:33

相关推荐

centos怎么启动linux系统时间 查看Centos系统最近一次启动时间和运行时间

CentOS的常用命令使用是基本功,需要查看系统的启动时间和运行时间,分享给大家一起学习,共同进步。

1.uptime命令[spark@MasterLog_Data]$uptime

09:18:01up20:17,1user,loadaverage:0.13,0.12,0.14

2.查看/proc/uptime文件计算系统启动时间[spark@MasterLog_Data]$cat/proc/uptime

73064.44276161.85

输出: 73064.44 276161.85 第一数字即是系统已运行的时间73064.44 秒,运用系统工具date即可算出系统启动时间

代码:[spark@MasterLog_Data]$date-d"$(awk-F.'{print$1}'/proc/uptime)secondago"+"%Y-%m-%d%H:%M:%S"

-12-0213:00:59

3.查看/proc/uptime文件计算系统运行时间

代码:[spark@MasterLog_Data]$cat/proc/uptime|awk-F.'{run_days=$1/86400;run_hour=($1%86400)/3600;run_minute=($1%3600)/60;run_second=$1%60;printf("系统已运行")

本文来自投稿,不代表访得立场,如若转载,请注明出处://view/1377.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。