方法1
#指令:lsb_release -a
範例:
[root@www ~]# lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.7 (Final) Release: 6.7 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
登入後複製
cat /etc/redhat-release
#(適用於RedHat,CentOS)##範例:
[root@www ~]# cat /etc/redhat-release CentOS release 6.7 (Final)
登入後複製
方法4
#:
#rpm -q redhat-releaserpm -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
登入後複製