How to check CentOS version number you are using

Alex KondratievAlex Kondratiev

5 min read

Releases - Versions - Numbers - Kernels


How to get the CentOS version number

All commands should be executed in your server's terminal. You should access the server via SSH and perform the following:

shell

1cat /etc/centos-release

Alternative commands to check the CentOS version:

shell

1cat /etc/redhat-release

and

shell

1cat /etc/system-release

and

shell

1cat /etc/os-release

The output should give you something similar to: CentOS Linux release 7.4.1708 (Core)
or

shell

1NAME="CentOS Linux"
2VERSION="7 (Core)"
3ID="centos"
4ID_LIKE="rhel fedora"
5VERSION_ID="7"
6PRETTY_NAME="CentOS Linux 7 (Core)"
7ANSI_COLOR="0;31"
8CPE_NAME="cpe:/o:centos:centos:7"
9HOME_URL="https://www.centos.org/"
10BUG_REPORT_URL="https://bugs.centos.org/"
11CENTOS_MANTISBT_PROJECT="CentOS-7"
12CENTOS_MANTISBT_PROJECT_VERSION="7"
13REDHAT_SUPPORT_PRODUCT="centos"
14REDHAT_SUPPORT_PRODUCT_VERSION="7"

Let me explain how to read the CentOS version number and what it means. You can see that you're using CentOS release 7 (this is the major version) and 4 (this is the minor version), third part 1708 is added for the 7th version only and indicates that the source code of this release is based on dates from August 2017.

Please keep in mind that you should always use the latest stable version of CentOS to access new features and address security vulnerabilities.

How to get the CentOS kernel version

If you want to check which kernel is used on your server, this command will help you:
uname -r
The output of the command should be similar to:

shell

13.10.0-693.17.1.el7.x86_64
2The output displays following keys:
3- 3 – Kernel Version
4- 10 – Major Revision
5- 0 – Minor Revision
6- 17.1.el7 – Fix/Revision Detail

uname command can also give the following information:

-a, --all : prints all information
-s, --kernel-name : prints the kernel name
-n, --nodename : prints the network node hostname
-r, --kernel-release : prints the kernel release
-v, --kernel-version : prints the kernel version
-m, --machine : prints the machine hardware name
-p, --processor : prints the processor type or "unknown"
-i, --hardware-platform : prints the hardware platform or "unknown"
-o, --operating-system : prints the operating system
--help : displays this help and exit
--version : outputs version information and exits

Conclusion

Now you can easily find the CentOS version and its kernel version. Also, you can read and understand the output. I want to point out that you might have another version of CentOS, and the version in my example may not be the latest or even outdated.

Alex Kondratiev

Alex Kondratiev

Founder of ITsyndicate. DevOps Enthusiast with 15+ years of experience in cloud, Infrastructure as Code, Kubernetes, and automation. Specialized in architecting secure, scalable, and resilient systems.

Plan the present.
Build the future.