1) Log in toServicelsb_release-a, you can list all version information, such as:
[email protected] ~]# lsb_release-a
LSB version:1.3
Distributor Id:redhatenterpriseas
description:red Hat Enterprise Linux as Release 4 (Nahant Update 1)
Release:4
codename:nahantupdate1
[email protected] ~]#
This command applies to all Linux, including Redhat, SuSE, Debian, and other distributions.
2) Log in to the Linux execution Cat/etc/redhat-release, as follows:
[email protected] ~]# cat/etc/redhat-release
Red Hat Enterprise Linux as Release 4 (Nahant Update 1)
[email protected] ~]#
in this way, you can see the specific version number directly, such as AS4 Update 1
3) Log in to Linux to perform rpm-q redhat-release such as the following
[email protected] ~]# rpm-q redhat-release
redhat-release-4as-2.4
[email protected] ~]#
In this way, you can see a so-called release number, such as the above example is 2.4
there is a certain correspondence between the release number and the actual version, as follows:
redhat-release-3as-1-Redhat Enterprise Linux as 3
redhat-release-3as-7.4-Redhat Enterprise Linux as 3 Update 4
redhat-release-4as-2-Redhat Enterprise Linux as 4
redhat-release-4as-2.4-Redhat Enterprise Linux as 4 Update 1
redhat-release-4as-3-Redhat Enterprise Linux as 4 Update 2
redhat-release-4as-4.1-Redhat Enterprise Linux as 4 Update 3
redhat-release-4as-5.5-Redhat Enterprise Linux as 4 Update 4
Note: The two types of (2) (3)Methodvalid only for Redhat Linux
Three common ways to view Linux versions