How to Check the Linux Kernel Version?

The Kernel is the essential component of any operating system because it manages the processes, resources, and provides a mechanism for communication between software and hardware. There are many Kernel versions available; you could face situations where you’ll have to check the version of the installed Linux kernel on your Linux system. For example, if you want to debug the hardware issue, then you will be interested in checking the Linux Kernel version.

This post presents various commands to check the installed Linux Kernel version on your Linux system. I am using Ubuntu 20.04 for preparing this article and executing the command. The commands used in this article are generic and can be used on other Linux based operating systems like Linux Mint, Fedora, Debian, etc.

Check the Linux Kernel version with the uname command

uname command displays the system information. To check the Linux Kernel installed version, type the below-given command:

$ uname -r

The output shows that the Linux Kernel version 5.10.0-051000 is installed on my Ubuntu 20.04 system. The explanation of the Kernel version is as follows:

5- Kernel version

10-Major revision

0-Minor revision

051000-Patch number

Whereas, the generic confirms that I am using the desktop version of Kernel.

Check Linux Kernel version using the dmesg command

The basic purpose of the dmesg command is to write the Kernel messages. It is also used for checking the Kernel version. Run the dmesg commands with the sudo privileges in the following way to check the Kernel version:

$ dmesg | grep Linux

Check Linux Kernel version using the hostnamectl command

The hostnamectl is a very useful command that is primarily used to change the system hostname. Additionally, it also shows the Kernel version.

$ hostnamectl

Specifically, to only check the Kernel version, use the grep command with hostnamectl:

$ hostnamectl | grep -i kernel

Check Linux Kernel version using the /proc/version file

The proc file system is a virtual file system that is created when the system is started, and it vanishes when the system shutdown. In the /proc file system, the Linux Kernel information is stored in the version file. The cat command can be used for printing the version file system content.

Type the below-given command to check the Linux Kernel version:

$ cat /proc/version

Conclusion

The article explains the various commands that we can use to check the installed Linux Kernel version. These commands work on various Linux distributions like Debian, CentOS, Fedora, Linux Mint, etc.



from Linux Hint https://ift.tt/36IYBHf

Post a Comment

0 Comments