There are several ways on how to check what version of CentOS is running on your system. Below you can find multiple examples on how to determine CentOS version. However, depending on your system not all examples may be applicable.
First, example uses
The next example uses
rpm command to do query for
centos-release package to reveal CentOS version:
# rpm --query centos-release
Yet, another alternative is to use
command. However, this command is part of
package and is not installed by default so the actual
command may be unavailable on your system. If this is the case it is recommended to use some other alternative approach on how to check CentOS version on your system.
# lsb_release -d
If none of the above does not reveal CentOS version we can try to query release numbers directly. Attempt to read the content of the following files to reveal CentOS version number: