Linux 下时间的设置与重置

来源:互联网 发布:常用的linux命令 编辑:程序博客网 时间:2024/06/04 18:28


需要先在Linux下面使用root用户,安装这个命令

yum install ntp

安装ntpdate

使用 date 命令查看当前的日期,

使用date -s "2017-11-01" 这样命令设置当前时间,

使用安装的ntp 可以重置最新的时间

ntpdate cn.pool.ntp.org


date -s "2017-11-01 `date +%T`"

这样可以只修改日期不更改时间



原创粉丝点击