How To Check The Kernel Version In Linux
In this tutorial, we’ll show you several different ways to find out what version of Linux kernel is running on your system.
The kernel is the core component of an operating system. It manages the system’s resources, and it is a bridge between your computer’s hardware and software.
There are various reasons why you might need to know the version of the kernel that is running on your GNU/Linux operating system. Perhaps you’re debugging a hardware related issue or learned about a new security vulnerability affecting older kernel versions and you want to find out whether your kernel is vulnerable or not. Whatever the reason, it’s quite easy to determine the Linux kernel version from the command line.
Using the uname Command
The uname command displays several system information including, the Linux kernel architecture, name version, and release.
To find out what version of the Linux kernel is running on your system, type the following command:
Using hostnamectl command
The hostnamectl utility is part of systemd, and it is used to query and change the system hostname. It also displays the Linux distribution and kernel version:
You can use the grep command to filter out the Linux kernel version:
Using /proc/version File
The /proc directory contains virtual files with information about the system memory , CPU cores , mounted filesystems , and more. Information about the running kernel is stored in the /proc/version virtual file.
Use cat or less to display the contents of the file:
The output will look something like this:
We have shown you how to find the version of the Linux kernel running on your system from the command line. The commands should work on all popular Linux distributions including, Debian, Red Hat, Ubuntu, Arch Linux, Fedora, CentOS, Kali Linux, OpenSUSE, Linux Mint, and more.