8 Possible Ways Of Checking Linux Kernel Version
Knowing the Linux Kernel version of your system is essential. It helps to identify compatibility issues, bugs, features, security issues, and many more. Linux Kernel is the core component of the Linux operating system.
In this article, I will show you 8 different ways of checking the Linux Kernel version. And the quickest of them is to use:
uname -r
Knowing the Linux kernel version can help you better understand your system and make informed decisions about upgrades, software compatibility, and troubleshooting.
What Is The Linux Kernel?
The Linux kernel is the core component of the Linux operating system. It is a low-level system software that manages and controls the underlying hardware of a computer, providing an interface between the hardware and the higher-level software components.
It acts as a bridge between the user space and the hardware. It performs several key functions such as process management, memory management, device driver management, and system call handling.
Linux kernel is designed to be highly modular and flexible, allowing for the easy addition and removal of functionality through the use of loadable kernel modules.
It is an open-source project and is widely used as the foundation for many different types of operating systems, including embedded systems, servers, and desktop computers.
Linux kernel is highly customizable and configurable, and it is constantly being improved and developed by a large community of developers from all over the world.
Why Do You Need To Know The Linux Kernel Version?
Knowing the Linux Kernel version is important for a number of reasons:
Reason | Explanation |
---|---|
Compatibility | Different versions of the Linux kernel may have different compatibility with different software and hardware components. Knowing the exact version of the kernel you are running can help you determine if your system is compatible with a particular software or hardware component. |
Debugging | If you are encountering issues with your system, knowing the Linux kernel version can help you determine if the problem is related to the kernel and if a newer version might resolve the issue. |
Security | Newer versions of the Linux kernel often contain security updates and patches for vulnerabilities. Knowing the version of the kernel you are running can help you determine if your system is vulnerable to known security issues and if an upgrade is necessary. |
Feature Support | Different versions of the Linux kernel support different features and hardware. If you are looking to use a specific feature or hardware component, knowing the version of the kernel you are running can help you determine if it is supported. |
Troubleshooting | If you are seeking support or assistance with a problem, knowing the Linux kernel version can provide valuable information to help diagnose and resolve the issue. |
List Of Linux Command For Kernel Version
To check the Linux Kernel version, you can use one of the following commands:
- uname -r
- cat /proc/version
- cat /proc/version_signature
- dmesg | grep “Linux version”
- hostnamectl OR hostnamectl | grep Kernel
- neofetch OR neofetch | grep Kernel
- ls /lib/modules
- inxi -Sz
#1. Check Linux Kernel Using – uname
The uname
command is the most commonly used method to find the Linux kernel version. To use this command, open a terminal window and type the following command:
uname -r
This will display the currently running version of the Linux kernel.
Example output:
5.15.0-58-generic
#2. Get Linux Kernel Version Using – cat /proc/version
The /proc/version
file contains information about the Linux kernel version and other system details. You can view the contents of this file by using the following command:
cat /proc/version
This will display information about the Linux kernel version, along with other system details.
Example output:
Linux version 5.15.0-58-generic (buildd@lcy02-amd64-101) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023
#3. Show Linux Kernel Version Using – cat /proc/version_signature
The /proc/version_signature
file contains information about the Linux kernel version. You can view the content of this file by using the following command:
cat /proc/version_signature
This will display information about the Linux kernel version.
Example output:
Ubuntu 5.15.0-58.64-generic 5.15.74
#4. Check Version Of Linux Kernel Using – dmesg
The dmesg
command is a Linux utility that displays the “message” buffer of the kernel. The message buffer is a ring buffer that contains messages generated by the Linux kernel and other system components.
The output of the dmesg
command will include a number of messages generated by the kernel and other system components. To find information about the Linux kernel version, you need to use the grep
command to filter the output. Use the following command:
dmesg | grep "Linux version"
Example output:
[ 0.000000] Linux version 5.15.0-58-generic (buildd@lcy02-amd64-101) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 (Ubuntu 5.15.0-58.64-generic 5.15.74)
#5. Use “hostnamectl” To Get Linux Kernel Version
The hostnamectl
command is a utility that is used to display and manage the hostname and related settings on Linux systems. It provides information about the hostname, operating system, kernel, and other system properties.
To display information about the Linux kernel using the hostnamectl
command, you can use the following command:
hostnamectl
Example output:
Static hostname: Linux-PC Icon name: computer-desktop Chassis: desktop Machine ID: b0d275fb46fa48c6820be57edaa22cf5 Boot ID: 043bc189961444999748e7086e705d5c Operating System: Linux Mint 21.1 Kernel: Linux 5.15.0-58-generic Architecture: x86-64 Hardware Vendor: Gigabyte Technology Co., Ltd. Hardware Model: H410M H V2
You can also filter the hostnamectl
command using the grep
command to find only the Kernel Version of your system. Use the following command to get the Linux Kernel version:
hostnamectl | grep Kernel
Example output:
Kernel: Linux 5.15.0-58-generic
#6. Check Linux Kernel Using – neofetch
neofetch
is a popular command-line system information tool for Linux and other Unix-like operating systems. It displays system information, such as the operating system name and version, desktop environment, hostname, and more, along with an ASCII logo of the operating system.
To display information about the Linux kernel using neofetch
, you can simply run the following command in a terminal:
neofetch
Example output:
You can also filter the neofetch
command using the grep
command to find only the Kernel Version of your system. Use the following command to get the Linux Kernel version:
neofetch | grep Kernel
Example output:
Kernel: 5.15.0-58-generic
#7. Find Linux Kernel Version Using – ls /lib/modules
The /lib/modules
directory contains all the loadable Linux kernels. You can use the ls
command to get the list of installed Linux Kernels.
Each directory within /lib/modules
corresponds to a specific version of the Linux kernel, and contains the modules that are required for that version of the kernel to operate. The name of each directory is the version number of the Linux kernel.
Use the following command to get a list of all the installed Linux Kernels.
ls /lib/modules
Example output:
5.15.0-41-generic 5.15.0-56-generic 5.15.0-57-generic 5.15.0-58-generic
This indicates what Linux kernel is installed on your system, and the corresponding kernel modules are stored in the respective /lib/modules/<linux kernel>
directory. For example /lib/modules/5.15.0-58-generic
#8. Get Linux Kernel Version Using – inxi
inxi
is a command-line system information tool for Linux and other Unix-like operating systems. It provides a comprehensive and detailed display of information about the system’s hardware configuration.
inxi
can be used to display information about the Linux kernel, as well as other system components such as the CPU, memory, storage, network, and more. To display information about the Linux kernel using inxi
, you can use the following command:
inxi
Example output:
CPU: quad core Intel Core i3-10100 (-MT MCP-) speed/min/max: 800/800/4300 MHz Kernel: 5.15.0-58-generic x86_64 Up: 2h 38m Mem: 6341.9/15717.1 MiB (40.4%) Storage: 1.41 TiB (15.0% used) Procs: 398 Shell: Bash inxi: 3.3.13
You can also filter the inxi
command using the grep
command to find only the Kernel Version of your system. Use the following command to get the Linux Kernel version:
inxi | grep Kernel
Example output:
Kernel: 5.15.0-58-generic x86_64 Up: 2h 39m Mem: 6365.7/15717.1 MiB (40.5%)
Conclusion
There are a lot of ways of checking the Linux Kernel version. But the quickest way is to use uname -r
command, and I use it every time. However, you can use the other methods if that suits you.