博客
关于我
Linux的时钟及常用的时间同步服务器地址
阅读量:660 次
发布时间:2019-03-15

本文共 1463 字,大约阅读时间需要 4 分钟。

在中,用于时钟查看和设置的主要有date、hwclock和clock命令。其中,clock和hwclock用法相近,但clock还支持Alpha硬件体系。由于绝大多数用户使用x86硬件体系,因此这两个命令在学习上可以视为一个整体。

  • 在虚拟终端中使用date命令查看和设置系统时间查看系统时钟的方法是使用以下命令:
  • date

    设置系统时钟的通用格式为:

    date 月日时分年.秒

    1. 使用hwclock或clock命令查看和设置硬件时钟查看硬件时钟的方法是使用以下命令:
    2. hwclock --show 或 # clock --show

      设置硬件时钟的方法是使用以下命令:

      hwclock --set --date="09/17/2003 13:26:00" 或 # clock --set --date="09/17/2003 13:26:00"

      硬件时钟和系统时钟同步的方法是:

      hwclock --hctosys 或 # clock --hctosys

      系统时钟和硬件时钟同步的方法是:

      hwclock --systohc 或 # clock --systohc

      1. 同步系统时钟和硬件时钟默认情况下,重启后硬件时钟和系统时钟同步。若不需要重启,可以使用以下命令同步:
      2. hwclock --hctosys 或 # clock --hctosys

        1. 同步到网络时间服务器若需要将服务器时间与网络时间服务器同步,可使用以下命令:
        2. ntpdate 210.72.145.44

          执行前需确保已停止NTP服务:

          /etc/init.d/ntpd stop

          中国大概能用的NTP时间服务器地址包括:server 133.100.11.8server 210.72.145.44server 203.117.180.36server 131.107.1.10server time.asia.apple.comserver 64.236.96.53server 130.149.17.21server 66.92.68.246server www.freebsd.orgserver 18.145.0.30server clock.via.netserver 137.92.140.80server 133.100.9.2server 128.118.46.3server ntp.nasa.govserver 129.7.1.66server ntp-sop.inria.frserver 210.72.145.44server ntp.sjtu.edu.cn

          其他高校NTP地址:s1a.time.edu.cn(北京邮电大学)s1b.time.edu.cn(清华大学)s1c.time.edu.cn(北京大学)s1d.time.edu.cn(东南大学)s1e.time.edu.cn(清华大学)s2a.time.edu.cn(清华大学)s2b.time.edu.cn(清华大学)s2c.time.edu.cn(北京邮电大学)s2d.time.edu.cn(西南地区网络中心)s2e.time.edu.cn(西北地区网络中心)s2f.time.edu.cn(东北地区网络中心)s2g.time.edu.cn(华东南地区网络中心)s2h.time.edu.cn(四川大学网络管理中心)s2j.time.edu.cn(大连理工大学网络中心)s2k.time.edu.cn(CERNET桂林主节点)s2m.time.edu.cn(北京大学)

          本文地址:

    转载地址:http://rgvmz.baihongyu.com/

    你可能感兴趣的文章
    python中execute是啥_python – 为什么“c.execute(…)”打破循环?
    查看>>
    python中exit和break区别_Python中exit()和sys.exit()之间的区别
    查看>>
    python中h5的用法
    查看>>
    python中http协议编程_HTTP编程
    查看>>
    python中if的效率_python中关于if-else使用性能的一点感悟
    查看>>
    python中import os_Python:相对导入与绝对导入(import)、os.path、__file__
    查看>>
    python中is和==操作符
    查看>>
    python中range()函数的返回值是多少?
    查看>>
    Python中range对象的使用以及打印九九乘法表
    查看>>
    Python中reshape函数参数-1的意思?
    查看>>
    Python中set.discard和set.remove方法之间的运行时差异?
    查看>>
    Python接口自动化测试企业级实战
    查看>>
    python中tkinter中value_输入字段中的python Tkinter get()值
    查看>>
    Python中wx.FlexGridSizer
    查看>>
    Python中xPath技术和BeautifulSoup的使用
    查看>>
    python中yield的用法详解——最简单,最清晰的解释
    查看>>
    python中‘set.intersection()‘的算法是什么?
    查看>>
    Python中一个图形中的多个绘图
    查看>>
    python中一个好的持久同步队列
    查看>>
    Python中不准确的对数
    查看>>