第1节:日期和时间
1.Linux的两种时钟:
系统时钟:由Linux内核通过CPU的工作频率进行的
硬件时钟:主板
2.相关命令
date 显示和设置系统时间
hwclock,clock 显示硬件时钟
-s,--hctosys 以硬件时钟为准,校准系统时钟
-w,--systohc 以系统时钟为准,校准硬件时钟
3.时区
/etc/localtime
4.显示日历
cal 显示当月日历
cal -y 显示当年日历


第2节:实验:时间同步
ntpdate ip
ntpdate -u 可以越过防火墙与主机同步
修改配置文件ntp.conf,永久联网后自动同步时间
nano /etc/ntp.conf
添加:server ip iburst
图001

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

 (Linux基础学习)第四章:简单学习Linux系统中的日期和时间 随笔
启动ntpd服务命令
CentOS7
systemctl start ntpd
CentOS6
service ntpd start
ntpdate同步更新时间:https://www.cnblogs.com/luchuangao/p/7795293.html(转载自:luchuangao)

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄