ubuntu在命令行下同步时间

Posted yahengwang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu在命令行下同步时间相关的知识,希望对你有一定的参考价值。

1. 修改 /etc/timezone的时钟为UTC时钟.

echo "Asia/Shanghai" > /etc/timezone

 

2.修改时区 

$sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

3.同步时钟服务器 

$sudo ntpdate cn.pool.ntp.org

  报错 21 Feb 03:04:30 ntpdate[19759]: the NTP socket is in use, exiting 解决方法,停止npdd服务

/etc/init.d/ntpd stop

4.写入Bios 

$sudo hwclock --systohc

 

https://blog.csdn.net/wfing/article/details/9213181

https://blog.51cto.com/upgirl/1136844?_t=t

以上是关于ubuntu在命令行下同步时间的主要内容,如果未能解决你的问题,请参考以下文章