To check for the version that CentOS and RedHat Enterprise Linux (“RHEL”) there are a couple of commands that are useful and will provide the desired results.
cat /etc/redhat-releaseCentOS release 5.7 (Final)
cat /etc/issue | grep releaseCentOS release 5.7 (Final)
lsb_release -rRelease: CentOS release 5.7 (Final)
If lsb_release is not available then use yum install to install it. yum install redhat-lsb
cat /etc/issueCentOS release 5.7 (Final)
Kernel \r on an \m