Depending on your family distro or the release version (6.7…7.1 etc) you need to use and look for specific information to know the which exactly is the version, here are some examples to know the exact version of the distribution you are using. CentOS / RedHat
Two different commands that show us the same results.
Let’s check both ways.
1. Looking under /etc folder…
[root@securitytweak opt]# cat /etc/centos-release
CentOS release 6.6 (Final)
Where you are going to check the file “centos-release” located in /etc folder. If you are looking for RHEL distro, do the following,
1. Go to /etc folder and do a “cat command” of the following file,
[root@securitytweak etc]# cat redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
2. Running a specific command to show more specific information…
[root@securitytweak opt]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.6 (Final)
There are two ways to get the same information about the version of your OS distro. Probably on RHEL, the second option does not work, so, check it with the first method.