美文网首页
Linux更改为中国上海时区

Linux更改为中国上海时区

作者: Feng_Sir | 来源:发表于2022-03-10 15:37 被阅读0次
#执行命令更改为中国上海时区:
[root@fwq ~]cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

#提示 cp: overwrite ‘/etc/localtime’? 时,输入 y 按回车确认即可。
[root@fwq ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cp: overwrite ‘/etc/localtime’? y
#设置时间自动同步
[root@fwq ~]yum install -y ntp
[root@fwq ~]ntpdate us.pool.ntp.org
#设置完成后执行命令检查一下当前时间是否与当地时间一致即可:
[root@fwq ~]date

相关文章

网友评论

      本文标题:Linux更改为中国上海时区

      本文链接:https://www.haomeiwen.com/subject/dlnfdrtx.html