700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > linux查看系统运行时间及启动时间

linux查看系统运行时间及启动时间

时间:2024-02-08 09:04:43

相关推荐

linux查看系统运行时间及启动时间

linux查看系统运行时间及启动时间

一、查看当前系统运行时间

方法一:

[root@host-39-108-217-12 ~]# uptime

09:46:42 up 9 days, 23:40, 1 user, load average: 0.21, 0.25, 0.15

方法二:

[root@host-39-108-217-12 ~]# cat /proc/uptime

862851.95 845442.67

注:第一数字即是系统已运行的时间862851.95,单位为秒,运用系统工具date即可算出系统启动时间。

运用date工具计算系统启动时间

[root@host-39-108-217-12 ~]# date “+%Y-%m-%d %H:%M:%S” -d “$(awk ‘{print $1}’ /proc/uptime) second ago”

-06-13 10:06:17

1

2

3

4

5

6

7

8

9

10

11

12

13

二、查看当前系统启动时间

方法一:who

[root@host-39-108-217-12 ~]# who -r

运行级别 3 -06-13 10:06

注:

who -b 查看最后一次系统启动的时间

who -r 查看当前系统运行时间

方法二:last reboot

[root@host-39-108-217-12 ~]# last reboot

reboot system boot 3.10.0-693.11.1. Wed Jun 13 18:06 - 09:59 (9+15:53)

reboot system boot 3.10.0-693.11.1. Sat May 26 20:35 - 09:59 (27+13:24)

reboot system boot 3.10.0-693.11.1. Sat May 26 20:31 - 12:34 (-7:-57)

reboot system boot 3.10.0-693.11.1. Fri Apr 20 01:31 - 17:33 (-7:-58)

wtmp begins Wed Apr 18 14:31:34

[root@host-39-108-217-12 ~]# last reboot | head -1

reboot system boot 3.10.0-693.11.1. Wed Jun 13 18:06 - 09:59 (9+15:53)

注:last reboot可以看到Linux系统历史启动的时间

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