查看當前操作系統版本信息:
[root@bearPC sbin]# cat /proc/version
Linux version 3.10.0-957.5.1.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #
查看內核信息:
[root@bearPC sbin]# uname -a
Linux bearPC 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
查看版本當前操作系統發行信息:
[root@bearPC sbin]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
更新(同步)時間。需要安裝 ntpdate
[root@master /]# yum install ntpdate
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirrors.163.com
* updates: mirrors.163.com
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:02
mysql57-community | 2.5 kB 00:00:00
updates | 2.9 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package ntpdate.x86_64 0:4.2.6p5-29.el7.centos will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=====================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================
Installing:
ntpdate x86_64 4.2.6p5-29.el7.centos base 86 k
Transaction Summary
=====================================================================================================================================
Install 1 Package
Total download size: 86 k
Installed size: 121 k
Is this ok [y/d/N]: y
Downloading packages:
ntpdate-4.2.6p5-29.el7.centos.x86_64.rpm | 86 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ntpdate-4.2.6p5-29.el7.centos.x86_64 1/1
Verifying : ntpdate-4.2.6p5-29.el7.centos.x86_64 1/1
Installed:
ntpdate.x86_64 0:4.2.6p5-29.el7.centos
Complete!
同步時間
[root@master /]# ntpdate time.windows.com
23 Nov 23:35:56 ntpdate[2146]: step time server 20.189.79.72 offset -28799.674890 sec