How to view the current Linux version

  

There are three main ways to view the Linux version:

1) Log in to the server and execute lsb_release -a to list all version information, for example:

[[email protected] ~]# lsb_release -a LSB Version: 1.3Distributor ID: RedHatEnterpriseASDescription: Red Hat Enterprise Linux AS release 4 (Nahant Update 1) Release: 4Codename: NahantUpdate1[[email protected] ~ ]#

This command applies to all Linux, including Redhat, SuSE, Debian and other distributions.

2) Log in to linux and execute cat /etc/redhat-release , for example: [[email protected] ~]# cat /etc/redhat-release Red Hat Enterprise Linux AS release 4 (Nahant Update 1)[[email protected] ~]#

This way you can directly see the specific version number, such as AS4 Update 1

3) Log in to linux to execute rpm -q redhat-release , for example,

[[email protected] ~]# rpm -q redhat-releaseredhat-release-4AS-2.4[[email protected] ~]#

You can see a so-called release number in this way. For example, the above example has a certain correspondence between the release number and the actual version, as follows:

redhat-release- 3AS-1 -> Redhat Enterprise Linux AS 3redhat-release-3AS-7.4 -> Redhat Enterprise Linux AS 3 Update 4redhat-release-4AS-2 -> Redhat Enterprise Linux AS 4redhat-release-4AS-2.4 -> Redhat Enterprise Linux AS 4 Update 1redhat-release-4AS-3 -> Redhat Enterprise Linux AS 4 Update 2redhat-release-4AS-4.1 -> Redhat Enterprise Linux AS 4 Update 3redhat-release-4AS-5. 5 -> Redhat Enterprise Linux AS 4 Update 4

Note: The two methods (2)(3) are only valid for Redhat Linux

Copyright © Windows knowledge All Rights Reserved