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
Source(s):
http://forums.devshed.com/linux-help-33/how-to-check-linux-version-no-365425.html
http://www.if-not-true-then-false.com/2010/upgrade-centos/
http://linux.die.net/man/1/lsb_release