Objective
To examine the version of your Linux kernel and CentOS installation.
Prerequisites
System running CentOS.
Steps
Step 1: Check Linux Kernel Version
You can check your linux system information, including the kernel version and release with the following command.
uname -r
The command will generate a series of information as such.
3.10.0-1127.e17.x86_64
The information above shows your Linux kernel version.
Step 2: Check CentOS Version using cat command
By default, CentOS has a file which records its version, known as centos-release, this file can be viewed by using the following command.
cat /etc/centos-release
The command will generate information as such.
CentOS Linux release 7.8.2003
Shown below is the breakdown of the command output:
7
-> major release
8
-> minor release
2003
-> asynchronous release
Step 3: Checking CentOS Version using hostnamectl command
On CentOS 7 and above, you can use the following command to quickly check the CentOS version, alongside other information.
hostnamectl
The command would show the following output: