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 ...
随机推荐
- SSE两个页面的相互通信
两个页面之间互相通信 首先搭建express框架,然后通过two页面发送数据给服务器,服务器把数据传送给one页面 在two 中发送数据,在one中显示 router/index.js var axi ...
- nodejs 导入导出模块module.exports向外暴露多个模块 require导入模块
.moudel.exports 导出模块 导出单个模块 // user.js moudel.exports = 函数名或者变量名: //app.js 导入 require('user.js') 当然. ...
- Current mirror drives multiple LEDs from a low supply voltage
Driving LEDs at a regulated current from low supply voltages can be difficult because minimal overhe ...
- The New Virtual List Box in Delphi 6 - lbVirtual lbVirtualOwnerDraw
http://users.atw.hu/delphicikk/listaz.php?id=2471&oldal=52 Problem/Question/Abstract: What are t ...
- SQL Server性能调优:资源管理之内存管理篇(上)
http://www.cnblogs.com/caspnet/archive/2011/02/21/1959539.html 对SQL Server来说,最重要的资源是内存.Disk和CPU,其中内存 ...
- 查找可用的谷歌IP地址
在终端下运行命令就可以: nslookup www.google.cn 就可以找到
- APP H5页面显示优化
在开发移动端APP页面时,对各操作系统各种型号的手机进行适配是必须的.然鹅,上周在开发完一个落地页后,被测试给打了回来,其中列出了一个在我看来很小的问题:单击进入页面的时候,页面还没加载完的时候字体显 ...
- matlab colormap
This table lists the built-in colormaps functions. Colormap Name Color Scale parula
- GOOGLE定位
GOOGLE定位 /// <author>cxg 2018-3-27</author> unit umap; interface uses System.SysUtils, S ...
- vim多行注释与取消
神操作 在vim中编写代码,常常会遇到多行注释和取消注释的情况,在VS中我们可以用默认的快捷键或者在设置中自定义快捷键来解决这个问题. vim既然这么强大,必然也是有快捷键来完成的.下面给出具体步骤: ...