首页 > 秒收录 > 文章资讯

5种摘录查看系统版本的方法 2021-04-30 11:50:02

摘录查看系统版本的几种方法方法一命令:lsb_release -a示例:[root @ www ~]# LSB _ release-AlSb version : base-4.0-amd 64: base-4.0-noarc : core-4.0-amd 64: core-4.0-noarc发行商id : CentOS description : CentOS release 6.7(最终)版本: 6.7

quot;Helvetica Neue", Helvetica, "PingFang SC", 微软雅黑, Tahoma, Arial, sans-serif; font-size: 14px; background-color: rgb(238, 238, 238);">Codename:    Final

方法2
命令:
uname
uname -r
uname -a //最全的
(适用于所有的linux,包括Redhat、SuSE、Debian、Centos等)

示例:


[root@www ~]# uname

Linux

[root@www ~]# uname -r

2.6.32-431.23.3.el6.x86_64

[root@www ~]# uname -a

Linux www 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

方法3
命令:
cat /etc/redhat-release
(适用于RedHat,CentOS)

示例:


[root@www ~]# cat /etc/redhat-release

CentOS release 6.7 (Final)

方法4
命令:
rpm -q redhat-release
rpm -q centos-release
(适用于RedHat,CentOS)

示例:(我没装redhat,装的是CentOs)

[root@www ~]# cat /etc/redhat-release

package redhat-release is not installed

[root@www ~]# rpm -q centos-release

centos-release-6-7.el6.centos.12.3.x86_64

方法5
命令:
cat /proc/version
(当前centos 版本与redhat对应的版本的命令)

示例:


[root@www ~]# cat /proc/version

Linux version 2.6.32-431.23.3.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC) ) #1 SMP Thu Jul 31 17:20:51 UTC 2014