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-releaseAlternative commands to check the CentOS version:
shell
1cat /etc/redhat-releaseand
shell
1cat /etc/system-releaseand
shell
1cat /etc/os-releaseThe 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_642The output displays following keys:3- 3 – Kernel Version4- 10 – Major Revision5- 0 – Minor Revision6- 17.1.el7 – Fix/Revision Detailuname 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.
