Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to view Linux system version information

Shulou Source: shulou.com Published: 2022-06-01 15:13:04 10月03日 Update

This article introduces the relevant knowledge of "how to view Linux system version information". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

How do I view the version information used by the Linux system? The following article collects and collates some common ways to view Linux system versions. Since there are only three versions of Linux, Oracle Linux, Centos Linux and Redhat Linux, the following methods have not been tested for Linux systems such as Debian and Ubuntu.

1:more / etc/issue command view

1.1 Oracle Linux

The code is as follows:

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

1.2 Centos Linux

The code is as follows:

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

1.3 RedHat Linux

The code is as follows:

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

2: lsb_release-a command to view

2.1 Oracle Linux

The code is as follows:

[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

The code is as follows:

[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

The code is as follows:

[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 command view

This command should be available to only part of the Linux, not all versions of Linux.

3.1 Oracle Linux

The code is as follows:

[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

The code is as follows:

[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

The code is as follows:

[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 command view, only applicable to Redhat Linux

The code is as follows:

[root@getlnx05] # rpm-Q redhat-release

Redhat-release-5Server-5.7.0.3

This is the end of the content of "how to View Linux system version Information". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Code version command system information content only method more knowledge practical learned next three dilemma actual common situation on hand article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Docker OPPO Reno Linux