同步时钟命令

hwclock

hwclock -s 将硬件时间同步到系统时间
hwclock -w 将系统时间同步到硬件时间
hwclock -v 查看版本

date

date 查看系统时间
date -s 设置系统时间

查看当前硬件时间
yu@ubuntu:~$ hwclock
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
yu@ubuntu:~$ sudo hwclock
[sudo] password for yu:
2019年11月06日 星期三 21时35分09秒 -0.849312 seconds

查看当前系统时钟
osen@ubuntu:~$ date
2019年 11月 06日 星期三 21:38:09 CST

设置系统时钟
yu@ubuntu:~$ sudo date -s 20191105
2019年 11月 05日 星期二 00:00:00 CST
yu@ubuntu:~$ sudo date -s “2019-11-6 21:50”
[sudo] password for yu:
2019年 11月 06日 星期三 21:50:00 CST

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值