gpt4 book ai didi

学习一个 Linux 命令:ntpdate

转载 作者:qq735679552 更新时间:2022-09-27 22:32:09 25 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章学习一个 Linux 命令:ntpdate由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

学习一个 Linux 命令:ntpdate

命令简介

  。

ntpddate 命令用于使用网络计时协议(NTP)设置日期和时间。还可以用于同步时间,此命令需要具备root管理员权限才可执行.

  1. [root@centos7 ~]# ntpdate 
  2. -bash: ntpdate: command not found 
  3. [root@centos7 ~]# yum install ntpdate -y 

语法格式

  。

ntpdate [ -b] [ -d] [ -s] [ -u] [ -aKeyid] [ -eAuthenticationDelay] [ -kKeyFile] [ -oVersion] [ -pSamples] [ -tTimeOut] Server... 。

选项说明 

  。

  1. -aKeyid  #使用 Keyid 来认证全部数据包 
  2. -b       #通过调用 settimeofday 子例程来增加时钟的时间 
  3. -d       #指定调试方式 
  4. -eAuthenticationDelay   #指定延迟认证处理的时间秒数。 
  5. -oVersion      #指定使用的 NTP 版本实现 
  6. -pSamples      #指定从每个服务器获取的样本的数目 
  7. -s          #指定日志操作 
  8. -tTimeOut   #指定等待响应的时间 
  9. -u          #指定使用无特权的端口发送数据包 

应用举例

  。

同步时间 。

  1. [root@centos7 ~]# date 
  2. Sun Mar 28 13:09:22 EDT 2021 
  3. [root@centos7 ~]# ntpdate 0.centos.pool.ntp.org 
  4. 28 Mar 23:11:13 ntpdate[5516]: step time server 182.92.12.11 offset 36090.505486 sec 
  5. [root@centos7 ~]# date 
  6. Sun Mar 28 23:11:21 EDT 2021 
  7.  
  8. [root@centos7 ~]# ntpdate 0.centos.pool.ntp.org 
  9. 28 Mar 23:11:55 ntpdate[5519]: step time server 182.92.12.11 offset -0.722305 sec 
  10. [root@centos7 ~]# ntpdate asia.pool.ntp.org;hwclock -w 
  11. 28 Mar 23:12:28 ntpdate[5520]: adjust time server 133.243.238.163 offset -0.013789 sec 

原文地址:https://mp.weixin.qq.com/s/_Dxrgn7-VGVZbR9bWJ4Ogw 。

最后此篇关于学习一个 Linux 命令:ntpdate的文章就讲到这里了,如果你想了解更多关于学习一个 Linux 命令:ntpdate的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com