How to find Linux version ?

Most of the time when we say a Linux version then we are referring to the specific Linux distributions…such as Red Hat, SuSe, Debian, Ubuntu, etc.

Below are the CLIs that list their distribution specific Linux versions.

On Red Hat Linux Distribution:

# cat /etc/redhat-release

On Novell SuSe Linux Distribution:

# cat /etc/SuSE-release

On Debian Linux Distribution:

# cat /etc/debian_version

On Ubuntu Linux Distribution:

# lsb_release –a

# cat /etc/lsb-release

The contents of these files shouldn’t be changed or altered since different server softwares such as the Oracle database refer to those files to decide their own compatibility. Sometimes /etc/issue or /etc/issue.net is also referred for their contents. However, it is not reliable since it is overwritten on some distributions during system boot.

To find the exact Linux kernel version installed on the machine, the following CLIs can be used…

# uname –a
Linux linux-bk6098 2.6.34.8-0.2-default #1 SMP 2011-04-06 18:11:26 +0200 i686 i686 i386 GNU/Linux

# cat /proc/version
Linux version 2.6.34.8-0.2-default (geeko@buildhost) (gcc version 4.5.0 20100604 [gcc-4_5-branch revision 160292] (SUSE Linux) ) #1 SMP 2011-04-06 18:11:26 +0200

If you know any Linux distribution that differs from the above CLI for determining their version then do post your comments below.

Note: We at TechSutram take our ethics very seriously. More information about it can be found here.
Mandar Pise Opinions expressed by techsutram contributors are their own. More details

Mandar is a seasoned software professional for more than a decade. He is Cloud, AI, IoT, Blockchain and Fintech enthusiast. He writes to benefit others from his experiences. His overall goal is to help people learn about the Cloud, AI, IoT, Blockchain and Fintech and the effects they will have economically and socially in the future.

1 comment:

    Your valuable comments are welcome. (Moderated)