溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

怎么查看Linux系統(tǒng)版本信息

發(fā)布時(shí)間:2021-08-06 18:53:00 來源:億速云 閱讀:113 作者:chen 欄目:系統(tǒng)運(yùn)維

本篇內(nèi)容介紹了“怎么查看Linux系統(tǒng)版本信息”的有關(guān)知識(shí),在實(shí)際案例的操作過程中,不少人都會(huì)遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

如何查看Linux系統(tǒng)使用的版本信息呢? 下面這篇文章收集、整理了一些常見的查看Linux系統(tǒng)版本的方法。由于手頭只有Oracle Linux、Centos Linux、Redhat Linux三個(gè)版本Linux,所以像Debian、Ubuntu之類的Linux系統(tǒng),下面方法在這些版本都沒測(cè)試過。

1:more /etc/issue 命令查看

1.1 Oracle Linux


代碼如下:


[root@DB-Server ~]# more /etc/issueOracle Linux Server release 5.7Kernel \r on an \m



1.2 Centos Linux
 

代碼如下:


[root@Centos2 ~]# more /etc/issueCentOS release 6.4 (Final)Kernel \r on an \m

 

1.3 RedHat Linux
 

代碼如下:


[root@getlnx05 ~]# more /etc/issueRed Hat Enterprise Linux Server release 5.7 (Tikanga)Kernel \r on an \m

 

2: lsb_release -a 命令查看 

2.1 Oracle Linux


代碼如下:


[root@DB-Server ~]# lsb_release -a
LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
Release:        5.7
Codename:       Carthage


2.2 Centos Linux

代碼如下:


[root@Centos2 ~]#  lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.4 (Final)
Release:        6.4
Codename:       Final


2.3 RedHat Linux

代碼如下:


[root@getlnx05 ~]#  lsb_release -a
LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Release:        5.7
Codename:       Tikanga


3:cat /etc/redhat-release 命令查看

這個(gè)命令應(yīng)該只有部分Linux可以查看,不是所有版本Linux都可以使用該命令

3.1 Oracle Linux

代碼如下:


[root@DB-Server ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)

[root@DB-Server etc]# cat /etc/*release
Enterprise Linux Enterprise Linux Server release 5.7 (Carthage)
Oracle Linux Server release 5.7
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@DB-Server etc]# ls  /etc/*lease
/etc/enterprise-release  /etc/oracle-release  /etc/redhat-release
[root@DB-Server etc]#


3.2 Centos Linux

代碼如下:


[root@Centos2 ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)

[root@Centos2 ~]# cat /etc/*release
CentOS release 6.4 (Final)
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
CentOS release 6.4 (Final)
CentOS release 6.4 (Final)
[root@Centos2 ~]# ls /etc/*release
/etc/centos-release  /etc/lsb-release  /etc/redhat-release  /etc/system-release
[root@Centos2 ~]#


3.3 RedHat Linux

代碼如下:


[root@getlnx05 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)

[root@getlnx05 ~]# cat /etc/*release
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@getlnx05 ~]# ls /etc/*release
/etc/redhat-release
[root@getlnx05 ~]#


4 rpm -q redhat-release命令查看,只適用于Redhat Linux

代碼如下:


[root@getlnx05 ~]# rpm -q redhat-release
redhat-release-5Server-5.7.0.3

“怎么查看Linux系統(tǒng)版本信息”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI