How to check the version of Red Hat Enterprise Linux and CentOS Linux
There are two ways to check the version of Red Hat Enterprise Linux or CentOS Linux:
-
Read the version in /etc/redhat-release.
cat /etc/redhat-release
CentOS release 5.2 (Final) //This means CentOS version 5 release 2
-
Use uname to check the version.
# uname -a Linux tum.ezylinux.com 2.6.18-92.1.18.el5 #1 SMP Wed Nov 12 09:19:49 EST 2008 x86_64 x86_64 x86_64 GNU/Linuxor
# uname -r 2.6.32-279.22.1.el6.x86_64
The second method does not show the distribution version directly. Instead, inspect the kernel version, since Red Hat and CentOS use a specific kernel version for each release: Red Hat Enterprise and CentOS version 3 use kernel version 2.4.21-* Red Hat Enterprise and CentOS version 4 use kernel version 2.6.9-* Red Hat Enterprise and CentOS version 5 use kernel version 2.6.18-* Red Hat Enterprise and CentOS version 6 use kernel version 2.6.32-*