查看Linux开机时间/重启时间

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/S630730701/article/details/79393573
总结一些查看Linux开机关机时间的方法
1: who 命令查看
      who -b 查看最后一次系统启动的时间。
      who -r 查看当前系统运行时间
linux运行时间:
1.uptime命令
输出:16:11:40 up 59 days, 4:21, 2 users, load average: 0.00, 0.01, 0.00
即为运行的4个小时21分钟

2.查看/proc/uptime文件计算系统启动时间
cat /proc/uptime
输出: 5113396.94 575949.85
第一数字即是系统已运行的时间5113396.94 秒,运用系统工具date即可算出系统启动时间

3.last  reboot
[root@master ~]# last  reboot
reboot   system boot  2.6.32-431.el6.x Tue Feb 27 20:55 - 21:34  (00:39)    
reboot   system boot  2.6.32-431.el6.x Tue Feb 27 08:41 - 17:30  (08:48)    
reboot   system boot  2.6.32-431.el6.x Mon Feb 26 22:16 - 22:45  (00:28)    
reboot   system boot  2.6.32-431.el6.x Mon Feb 26 21:45 - 22:10  (00:24)    
reboot   system boot  2.6.32-431.el6.x Mon Feb 26 08:41 - 17:25  (08:44)    
reboot   system boot  2.6.32-431.el6.x Sun Feb 25 08:41 - 16:51  (08:10)    
reboot   system boot  2.6.32-431.el6.x Sat Feb 24 20:48 - 22:10  (01:21)    
reboot   system boot  2.6.32-431.el6.x Sat Feb 24 08:41 - 17:25  (08:44)    
reboot   system boot  2.6.32-431.el6.x Fri Feb 23 23:16 - 23:24  (00:07)    
reboot   system boot  2.6.32-431.el6.x Fri Feb 23 08:41 - 17:12  (08:31)    

reboot   system boot  2.6.32-431.el6.x Thu Feb 22 20:31 - 22:10  (01:38)

....

其中第一行 20:55 - 21:34  (00:39)   表示开机时间20:55 当前时间21:34   运行时间:39分钟  (系统还有运行中,再执行下last reboot  21:34 会发生变化)

其中第二行 08:41 - 17:30  (08:48)   表示上次开机时间08:41 关机时间17:30 运行时间:8小时48分钟  (不再改变)


猜你喜欢

转载自blog.csdn.net/S630730701/article/details/79393573