CentOS7 时间设置与网络同步
1.查看时区
[root@localhost /]# date -R
Thu, Jul :: +
+0800表示东八区,这边就不用再设置
时区中的CST表示中国标准时间。
时区相关共享文件在/usr/share/zoneinfo下,中国一般选择/usr/share/zoneinfo/Asia/Shanghai.
如果时区错误要设置,就执行下面命令:
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2.查看系统时间
[root@localhost etc]# date
2018年 07月 12日 星期四 :: CST
3.查看硬件时间
[root@localhost etc]# hwclock
2018年07月12日 星期四 19时10分23秒 -0.210599 秒
4.网络同步时间
[root@localhost etc]# yum -y install ntp ntpdate
......
[root@localhost etc]# ntpdate cn.pool.ntp.org
Jul :: ntpdate[]: step time server 85.199.214.101 offset -28374.974285 sec
[root@localhost etc]# date
2018年 07月 12日 星期四 :: CST
先安装ntpdate工具
再设置系统时间与网络时间同步
再次查看时间,就与真实时间一样了
5.将系统时间写入硬件时间
[root@localhost etc]# hwclock -w
6.强制系统时间写入CMOS中防止重启失效
hwclock -w
或clock -w
参考:
https://blog.csdn.net/u011391839/article/details/62892020
https://www.douban.com/note/548483860/
CentOS7 时间设置与网络同步的更多相关文章
- CentOS7时间设置及ntp同步配置(转)
出处:http://www.centoscn.com/CentOS/config/2015/1105/6385.html http://www.centoscn.com/CentOS/config/2 ...
- linux 设置与网络同步的时间
#设置linux时间 与网络时间同步安装命令yum install -y ntp同步网络时间ntpdate ntp1.aliyun.com
- CentOS7时间和日期的同步 (chrony和)
CentOS 6版本,使用 hwclock CentOS 7版本,使用timedatectl 1.基本概念 1.1 GMT,UTC,CST,DST时间 世界标准时间 整个地球分为二十四时区,每个时区都 ...
- centos7 时间设置
安装完成centos7后,虽然时区选择的是上海,但是最终的时间还是不对,因为没有开启自动同步NTP功能,所以需要自动手动设置. 首先输入timedatectl命令,查看当前机器的时间: Local t ...
- CentOS7时间设置问题
本地安装一个VMWare player虚拟机客户端,并安装了Linux CentOS7 Basic Web Server系统,时区在安装时已经选择了Asia/Shanghai,但是安装完成后,时间和当 ...
- centos7 时间设置及ntp
转自:https://blog.gtwang.org/linux/howto-set-date-time-from-linux-command-prompt/ 這裡介紹各種在 Linux 中以手動來調 ...
- Linux 时间设置和同步服务
修改日期时间的工具 date hwclock timedatectl date工具的使用 作用:显示和设置系统时间 选项: -d <字符串> 显示字符串所指的日期与时间,比如:" ...
- centos7 时间自动同步
设置开机自动同步Internet时间,并作定时同步任务1.修改时区 rm -rf /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc ...
- CentOS7日期时间设置方法以及时间基本概念介绍
在CentOS 6版本,时间设置有date.hwclock命令,从CentOS 7开始,使用了一个新的命令timedatectl. 一.基本概念 1.1 GMT.UTC.CST.DST 时间 (1) ...
随机推荐
- 在liunx系统里面进行复制文件的时候报错:cp:omitting directiory
在复制的时候执行命令:cp /TEST/test1 /TEST/test2 结果报错:cp:omitting directior 报错原因:test1下面还有文件,不能删除 解决办法:cp -r / ...
- html5 手机端 通讯录 touch 效果
不说那么多直接上代码. <html> <head> <meta http-equiv="Content-Type" content="tex ...
- MPI Maelstrom(East Central North America 1996)(poj1502)
MPI Maelstrom 总时间限制: 1000ms 内存限制: 65536kB 描述 BIT has recently taken delivery of their new supercom ...
- Vue系列之 => 自定义键盘修饰符
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- html5-figure和figcaption元素
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8&qu ...
- Spark核心RDD:combineByKey函数详解
https://blog.csdn.net/jiangpeng59/article/details/52538254 为什么单独讲解combineByKey? 因为combineByKey是Spark ...
- python中函数嵌套、函数作为变量以及闭包的原理
嵌套函数: python允许创建嵌套函数.也就是说我们可以在函数里面定义函数,而且现有的作用域和变量生存周期依旧不变. 例子: #encoding=utf-8 def outer(): name ...
- .NET创建一个即是可执行程序又是Windows服务的程序
不得不说,.NET中安装服务很麻烦,即要创建Service,又要创建ServiceInstall,最后还要弄一堆命令来安装和卸载. 今天给大家提供一种方式,直接使用我们的程序来安装/卸载服务,并且可以 ...
- jquery操作节点
var v= $("input[type='checkbox'][name='ids']:checked").closest('tr').find('td:eq(2)').map( ...
- flask框架----数据库连接池
数据库连接池 flask中是没有ORM的,如果在flask里面连接数据库有两种方式 一:pymysql 二:SQLAlchemy 是python 操作数据库的一个库.能够进行 orm 映射官方文档 s ...