Linux命令-更新系统时间和硬件时间
查看系统时间和时区:
date 查看系统时间
date -R 查看时区
修改时区:
tzselect 修改时区
或
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 上海时间
或
rm /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 上海时间
ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime 洛杉矶时间
修改时钟文件:
/etc/sysconfig/clock
修改为:
ZONE="Asia/Shanghai"
UTC=false
ARC=false
修改系统时间:
date 查看当前系统时间
yum install -y ntpdate 安装ntpdate程序
ntpdate time.windows.com 从互联网更新系统时间
ntpdate cn.pool.ntp.org 从互联网更新系统时间
date 再次查看当前系统时间
如果ntpdate time.windows.com出错了.

lsof -i:123 查看123端口使用情况
kill - 1469 杀死进程
ntpdate time.windows.com 同步时间

同步BIOS时钟,强制把系统时间写入CMOS
clock --show 查看硬件时间
clock -w 强制把系统时间写入CMOS
clock --show 查看硬件时间
reboot 重起机器
重新启动系统,硬件时间会读取系统时间,实现同步;但是在不重新启动的时候,需要用hwclock或clock命令实现同步。
硬件时钟与系统时钟同步:hwclock --hctosys (hc代表硬件时间,sys代表系统时间)或者 clock --hctosys
系统时钟和硬件时钟同步:hwclock --systohc或者 clock --systohc
让linux自动从time.windows.com自动同步时间
vi /etc/crontab
加上一句自动同步时间:
00 0 1 * * ntpdate -s time.windows.com --每天凌晨1点
* */1 * * * ntpdate -s time.windows.com --每一个小时
* */1 * * * ntpdate -s cn.pool.ntp.org
Linux命令-更新系统时间和硬件时间的更多相关文章
- Linux命令更新系统时间,更新所有文件的时间(转)
https://blog.csdn.net/ccj2020/article/details/76026606
- linux 系统文件类型、系统安装时间、系统启动时间、系统运行时间、设置及显示时间、系统时间和硬件时间
系统文件类型: 1) $mout 2) df -l:仅列出本地文件系统:-h (--human-readable):-T:文件系统类型 $df -lhf 3) file -s (--special-f ...
- Linux系统时间和硬件时间设置
在Linux中有硬件时钟与系统时钟两种时钟.硬件时钟是指主机板上的时钟设备,也就是通常可在BIOS画面设定的时钟.系统时钟则是指kernel中的时钟.所有Linux相关指令与函数都是读取系统时钟的设定 ...
- CentOS 6.9系统时间和硬件时间设置(转)
总结一下hwclock,这个容易晕: 1)/etc/sysconfig/clock 文件,只对 hwclock 命令有效,且只在系统启动和关闭的时候才有用(修改了其中的 UTC=true 到 UTC= ...
- CentOS 7修改系统时间及硬件时间
转载于:https://www.cnblogs.com/LouisZJ/p/8554991.html [root@nginx ~]# timedatectl --help timedatectl [O ...
- Centos7 修改系统时间和硬件时间不一致的问题
查看系统时间 [root@localhost ~]# dateSat Feb 24 14:41:22 CST 2018 查看硬件时间 [root@localhost ~]# hwclock --sho ...
- CentOS7系统时间和硬件时间不同步问题
CentOS7系统中有两个时间:系统时间 和 硬件时间 我们常用命令 date 会输出系统时间,用 date 命令修改的也是系统时间 硬件时间是写入到 BIOS 中的时间,用 hwclock -r 命 ...
- CentOS 系统时间与硬件时间
date 系统时间查看 date -s 'YYYYMMDD HHMMSS' 设置系统时间 hwclock 硬件时间查看 hwclock -w 将系统时间同步到硬件时间 cp /usr/share/zo ...
- Linux 系统时间和硬件时间
linux 的系统时间有时跟硬件时间是不同步的 Linux时钟分为系统时钟(System Clock)和硬件(Real Time Clock,简称RTC)时钟.系统时钟是指当前Linux Kernel ...
随机推荐
- iptables数据包、连接标记模块MARK/CONNMARK的使用(打标签)
MARK标记用于将特定的数据包打上标签,供iptables配合TC做QOS流量限制或应用策略路由. 看看和MARK相关的有哪些模块: ls /usr/lib/iptables/|grep -i mar ...
- Simple dc/dc converter increases available power in dual-voltage system
The schematic in Figure 1 shows a way to increase the power available from a current-limited 5V supp ...
- eclipse.ini 文件使用说明
http://wiki.eclipse.org/Eclipse.ini Overview Eclipse startup is controlled by the options in $ECLIPS ...
- MYSQL SSL
http://dev.mysql.com/doc/refman/5.6/en/grant.html
- 简化delegate写法
标准的写法 空 简化后的宏 /**************************************************************/ // delegate 托付 /* #de ...
- linux中grep命令的使用
转载:http://blog.csdn.net/universsky/article/details/8866402 linux中grep命令的使用 grep (global search regul ...
- jquery获取table指定行和列的数据(当前选中行、列)
//不多说,直接上代码.$("table tr").click(function() {//为表格的行添加点击事件 var tr = $(this);//找到tr原色 var td ...
- 【GISER&&Painter】Chapter01:WebGL渲染初体验
基于上一篇OpenGL的渲染原理,这两周又陆续接触了一些关于WebGL绘图的一些内容,因为刚入门,很多东西又很晦涩,所以特意花了小半天的时间整理了一下,特此记录. 零 画一个多边形吧! 把一个多边形 ...
- 更改Thunderbird的默认语言
使用的Thunderbird Poratable版本是英文的,可以用以下方式修改为中文界面: 1.下载中文语言包 在官方网站的https://addons.mozilla.org/en-US/thun ...
- http://www.cnblogs.com/zhoujinyi/p/3437475.html
http://www.cnblogs.com/zhoujinyi/p/3437475.html