博客日记
您现在的位置是:博客主页 > 博客日记

Linux系统如何查看版本信息

By 点想博主 on 博客日记 Time 2019-11-02 from:互联网 329人已围观
简介:    查看当前操作系统内核信息uname -a,查看当前操作系统版本信息 cat /proc/version,查看当前操作系统发行版信息cat /etc/issue 或 cat /etc/redhat-release,查看cpu相关信息,包括型号、主频、内核信息等 cat /proc/cpuinfo

1、查看当前操作系统内核信息

uname -a

[root@ihdemj0ovr /]# uname -a
Linux ihdemj0ovr 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

2、查看当前操作系统版本信息

cat /proc/version

[root@ihdemj0ovr /]# cat /proc/version
Linux version 3.10.0-957.21.3.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) #1 SMP Tue Jun 18 16:35:19 UTC 2019

3、查看当前操作系统发行版信息

cat /etc/issue 或 cat /etc/redhat-release

[root@ihdemj0ovr /]# cat /etc/issue
S
Kernel r on an m
[root@ihdemj0ovr /]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core) 

4、查看cpu相关信息,包括型号、主频、内核信息等

cat /proc/cpuinfo

[root@ihdemj0ovr /]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core) 
[root@ihdemj0ovr /]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 79
model name      : Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
stepping        : 1
microcode       : 0x1
cpu MHz         : 2500.028
cache size      : 40960 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
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 eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt spec_ctrl intel_stibp
bogomips        : 5000.05
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:
processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 79
model name      : Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
stepping        : 1
microcode       : 0x1
cpu MHz         : 2500.028
cache size      : 40960 KB
physical id     : 0
siblings        : 2
core id         : 0
cpu cores       : 1
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
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 eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt spec_ctrl intel_stibp
bogomips        : 5000.05
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

5、列出所有版本信息

lsb_release -a
[root@ihdemj0ovr /]# lsb_release -a
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:       Core
[root@ihdemj0ovr /]# lsb_release -a
-bash: lsb_release: command not found

出现command not found说明没安装lsb_realease,可以执行命令yum install -y redhat-lsb安装lsb_realease,安装完成后,版本信息如下:

[root@ihdemj0ovr /]# lsb_release -a
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:       Core
相关文章
文章评论

( 0 )