Check CentOS version from the Command Line

In this tutorial, we will look at how to check our CentOS version from the command line. As a system administrator, the first question you should ask yourself after getting a new CentOS server to manage is: what version of CentOS am I running? The version of the operating system in use on our server is important as it is critical that we have all the latest updates to ensure that the server is secure.

There are 3 main ways of checking the version of CentOS that is running using a terminal.

How to check CentOS version from the command line

Run the following command in a terminal:

cat /etc/redhat-release

The result will be something like:

CentOS release 5.5 (Final)

Method 2

Alternately, you can run the following command in a terminal:

rpm -q centos-release

The result will be something like:

centos-release-5-5.el5.centos.1

Method 3

Or you can run the following command in a terminal if lsb_release is available:

lsb_release -d

The result will be something like:

Description: CentOS release 5.5 (Final)

As simple as that, we have determined that our server is running CentOS 5.5. Any of the methods above should help us to identify our CentOS version, though the results may be formatted a bit differently. Try them all and see how they work.

That is all there is to checking your CentOS version. We hope you found this tutorial useful.

Thank Tutorial Arena for This Tutorial.
Show your appreciation with a +1...