关于linux时间

时区确定
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

查看硬件时间
hwclock --show

将系统时间写入硬件时间
hwclock --systohc

同步时间
ntpdate dlhtHadoop101

同步的时候出现the NTP socket is in use, exiting 这个错误,需要关闭一下ntp服务,即/etc/init.d/ntpd stop

将硬件时间写入到系统中
clock -w


/etc/init.d/ntpd stop

原文地址:https://www.cnblogs.com/hark0623/p/4816379.html