linux查看操作系统版本信息
⼀、linux下如何查看已安装的centos版本信息:
  1.Linux查看当前操作系统版本信息  cat /proc/version
  Linux version 3.10.0-957.21.3.el7.x86_64 (mockbuild@s.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Tue Jun 18 16:35:19 UTC 2019
  2.Linux查看版本当前操作系统内核信息 uname -a
  Linux swarm-node1 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  3.Linux查看cpu相关信息,包括型号、主频、内核信息等 cat /proc/cpuinfo
  processor        : 0
  vendor_id        : GenuineIntel
  cpu family       : 6
  model              : 85
  model name      : Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
  stepping          : 7
  microcode        : 0x1
  cpu MHz            : 2500.002
  cache size          : 36608 KB
  physical id        : 0
  siblings          : 4
  core id            : 0
  cpu cores        : 2
  apicid              : 0
  initial apicid       : 0
  fpu                : yes
  fpu_exception      : yes
  cpuid level        : 22
  wp              : yes
  flags              : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc eagerfpu pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1
sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat avx512_vnni   bogomips          : 5000.00
  clflush size          : 64
  cache_alignment        : 64
  address sizes        : 46 bits physical, 48 bits virtual
  power management  :
⼆、uname的使⽤
  uname命令⽤于打印当前系统相关信息(内核版本号、硬件架构、主机名称和操作系统类型等)。
  uname -a显⽰全部信息
-m或--machine:显⽰电脑类型;
-r或--release:显⽰操作系统的发⾏编号;
-s或--sysname:显⽰操作系统名称;
-v:显⽰操作系统的版本;
-p或--processor:输出处理器类型或"unknown";
-
i或--hardware-platform:输出硬件平台或"unknown";
-o或--operating-system:输出操作系统名称;
--help:显⽰帮助;
--version:显⽰版本信息。
三、查看Linux版本
  1.查看系统版本信息的命令 lsb_release -a
  (使⽤命令时提⽰command not found,需要安装yum install redhat-lsb -y)linux版本命令
  LSB Version:    :core-4.1-amd64:core-4.1-noarch
  Distributor ID:    CentOS
  Description:    CentOS Linux release 7.6.1810 (Core)
  Release:    7.6.1810
  Codename:    Cor
注:这个命令适⽤于所有的linux,包括、、Debian等发⾏版。
  2.查看centos版本号 cat /etc/redhat-release
  CentOS Linux release 7.6.1810 (Core)