linux小結(3):查看linux版本

來源:互聯網
上載者:User

標籤:整理   適用於   技術分享   bsp   erp   blog   visible   inline   text   

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

 

1:more /etc/issue 命令查看

1.1 Oracle Linux

 
[[email protected] ~]# more /etc/issue
Oracle Linux Server release 5.7
Kernel \r on an \m

 

1.2 Centos Linux

[[email protected] ~]# more /etc/issue
CentOS release 6.4 (Final)
Kernel \r on an \m

 

1.3 RedHat Linux

[[email protected] ~]# more /etc/issue
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
Kernel \r on an \m

 

2: lsb_release -a 命令查看

 

2.1 Oracle Linux

[[email protected] ~]# 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

[[email protected] ~]#  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

[[email protected] ~]#  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 命令查看

這個命令應該只有部分Linux可以查看,不是所有版本Linux都可以使用該命令

3.1 Oracle Linux

[[email protected] ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
 
[[email protected] 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)
[[email protected] etc]# ls  /etc/*lease
/etc/enterprise-release  /etc/oracle-release  /etc/redhat-release
[[email protected] etc]# 

 

3.2 Centos Linux

[[email protected] ~]# cat /etc/redhat-release 
CentOS release 6.4 (Final)
 
[[email protected] ~]# 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)
[[email protected] ~]# ls /etc/*release
/etc/centos-release  /etc/lsb-release  /etc/redhat-release  /etc/system-release
[[email protected] ~]# 

 

3.3 RedHat Linux

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

 

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

 

[[email protected] ~]# rpm -q redhat-release
 
redhat-release-5Server-5.7.0.3

linux小結(3):查看linux版本

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.