How to Check CentOS Version in Linux

When you login to a Linux CentOS server, the first thing you might want to do is to determine what version of centos you are using. We have more that one command to find centos version information. So let's see how to use those methods to check CentOS version in Linux.


centos-release file inside /etc directory contains CentOS version information. Using cat command we can easily read the content of the file. So open the terminal and execute the following command.

cat /etc/centos-release

Output will be similar to below screenshot shows

How to Check CentOS Version in Linux

Similarly, following two files /etc/redhat-release and cat /etc/system-release can be used for the centos version check.

cat /etc/redhat-release

cat /etc/system-release

cat /etc/redhat-release

Using lsb_release command

As I said before there is more than one way to check CentOS version in Linux. Another easy method is to use lsb_release which is not installed as part of the default installation. So use yum command to install redhat-lsb-core package.

yum install redhat-lsb-core

Then use lsb_release with -a option as follows.

lsb_release -a

lsb_release check centos version command

As you can see lsb_release command provides more detailed output. But all those options we saw provides enough information we need. So it is up to you to decide which method you use to centos version check.