Sometimes we may need to check Linux kernel version information. In the previous article, we explained methods to find the Linux version. Current latest Linux kernel version details are available at https://www.kernel.org/. To find the kernel details we can follow the methods
- uname command
- hostnamectl command
- /proc/version file
- dmesg command
Check kernel version using uname command
To display system information we can use uname command. Open the terminal and type the following command.
From the above uname output it is clear that we are running Linux version 4.19.
Find kernel version using hostnamectl command
To query and change the system hostname and related settings hostnamectl command is used. Firstly, open the terminal and type the following command
hostnamectl hostnamectl | grep Kernel
The grep command will filter out the version from hostnamectl command output.
Using /proc/version file
The /proc/version file specifies the version of the Linux kernel and compiler used to compile the kernel. Open the terminal and run the following command
The above command output shows the kernel and GCC(GNU Compiler Collection) compiler details.
Using dmesg command
The dmesg command can be used to print or control kernel ring buffer. The kernel ring buffer is a special kind of data structure that records messages related to the operations of the kernel. Enter the following command in the terminal to check the Linux kernel version.
sudo dmesg | grep Linux
Thus, the first line in the output shows the kernel version.
In conclusion, it is simple to check the Linux kernel version using the above methods.