The Wayback Machine - https://web.archive.org/web/20240921051819/https://www.geeksforgeeks.org/how-to-check-kernel-version-in-linux/
Open In App

How to Check Kernel Version in Linux

Last Updated : 16 Jan, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

The kernel in the Linux Operating System is the core brain component of OS. Kernel in Linux OS is mainly a bridge between the hardware and the software layers. All the necessary services and the functionalities of the OS and the application are been provided by Kernel. The kernel has its version which differs according to the system. Knowing this version of the Kernel can be important when we need to perform the troubleshooting of our system hardware or in the scenario of system maintenance.

There is the standard format of kernel which is represented in the form of “a.b.c“. Each numerical has its specification which is stated below:

  • Major Version (a): The major version of Kernel describes the important updates and changes to the Kernel. All the architectural changes, newly added features, etc. are represented using the Major Version.
  • Minor Version (b): The minor version of the Kernel describes or presents the smaller updates, recent bug fixes, and some potential feature improvements in the major version. All the minor versions are created to be reversed compatible, in summary, minor versions can be applied to the same major version without introducing any problems.
  • Patch Level (c): The patch level of the Kernel describes the incremental updates and some bug fixes that are associated with the above minor version. Patch level is associated with resolving software bugs, addressing security flaws, etc. These are reversed and compatible with the same major and minor versions without introducing any issues with the compatibility.

How to Check Kernel Version in Linux?

To check the Kernel Version in Linux, we have different types of ways and methods that will help us to get the kernel version of the system. Below are the ways through which we can get the kernel version:

So, we will get the version of the kernel by using all these above-specified methods:

How to Check Kernel Version Using uname Command in Linux

We can check the version of the kernel using the uname command. uname (Unix Name) is used to display the system information. To get the specific kernel version we can use the ‘r’ flag along with the command. So execute the below command in the terminal to get the version of the Kernel

uname -r



Output:

Checking Kernel Version using uname command

Checking Kernel Version using uname command

From the above screenshot:

  • 5: This is the Major Version
  • 18: This is the Minor Version
  • 0: This is the Patch Level
  • kali5-amd64: This is the Distribution Name

How to Check Kernel Version Using hostnamectl Command in Linux

In this method, we will be checking the Kernel Version using hostnamectl command. hostnamectl command in Linux is used to display the system config information. It also displays the kernel version. So use the below command in the terminal to get the kernel version.

hostnamectl 



Output:

Checking Kernel Version using hostnamectl command

Checking Kernel Version using hostnamectl command

How to Check Kernel Version by viewing /proc/version File in Linux

In this method, rather than using the inbuilt command, we will check the version by viewing the contents of the /proc/version file. This file has various information about the system like compiler details, kernel version, build information, etc. We just need to view the file using the cat command or else we can also use the various text editors like vi, and vim to view the file. Run the below command in the terminal to check the version.

cat /proc/version



Output:

Checking Kernel Version by viewing /proc/version file

Checking Kernel Version by viewing /proc/version file

How to Check Kernel Version Using dmesg Command in Linux

In this method, we will be using the dmesg command to get the kernel version. dmesg command in Linux is used to display the kernel messages that are created during the booting process of the system. So from these messages, we can check the kernel version. Execute the below command in the terminal.

sudo dmesg | grep Linux



Output:

Checking Kernel Version using dmseg command

Checking Kernel Version using dmseg command

How to Check Kernel Version Using the dpkg Command in Linux

In this method, we will be using the built-in dpkg command to check the kernel version. Using the -l flag with the command, we can get the information about the list of installed packages and also the kernel version. We need to pipe the output by using the grep command.

dpkg -l | grep linux-image



Output:

Checking Kernel Version using dpkg command

Checking Kernel Version using the dpkg command

How to Check Kernel Version Using the ls Command for Kernel Images in Linux

In this method, we will check the kernel version using the inbuilt ls command. We need to use the ls command in the /boot directory to list the installed kernel images then we can identify the versions easily. Execute the below command in the terminal to get the kernel version.

ls /boot/vmlinuz-*


Output:

Checking Kernel Version using ls command

Checking Kernel Version using ls command

Conclusion

In conclusion, knowing the kernel version is an essential task while working in a Linux environment, as this can help many administrators troubleshoot system issues. Many methods can be used to check the version of the kernel in Linux. By using inbuilt commands like dmesg, hostnamectl, uname it is easy to check the kernel version, but also, there are some configuration files that stores the information of the kernel. So by checking the contents of the files, we can easily retrieve the kernel version of our Linux system.



Similar Reads

How to Check If a Linux Kernel Supports My System Devices
Finding the right drivers and information about them is very crucial if we want to check their compatibility with our system. There are a lot of techniques and commands that you can use to gather information about your system devices. The Linux distribution that we will be using in this article will be CentOS. You can choose any system of your choi
3 min read
Linux Kernel
Linux Kernel is the heart of Linux operating systems. It is an open-source (source code that can be used by anyone freely) software that is most popular and widely used in the industry as well as on a personal use basis. Who created Linux and why? Linux was created by Linus Torvalds in 1991 as a hobby project. Since then, many of the users have con
4 min read
Ksplice Install Linux Kernel Updates without Reboot
The Ksplice software allows changes/patches to be made to the running kernel without the need for any reboot. Important patches are made while the system is still running and there is no need to restart the computer. The software was acquired by Oracle in 2011 and is also known as the Oracle Ksplice. Why do systems need to reboot in the first place
7 min read
How Linux Kernel Boots?
Many processes are running in the background when we press the system's power button. It is very important to learn the booting process to understand the working of any operating system. Knowing how the kernel boots is a must to solve the booting error. It is a very interesting topic to learn, let us start with the basics. A simplified read of the
6 min read
Linux Loadable Kernel Module
If you want to add code to a Linux kit, the basic way to do that is to add source files to the kernel source tree and assemble the kernel. In fact, the process of setting up the kernel consists mainly of selecting which files to upload to the kernel will be merged. But you can also add code to the Linux kit while it is running. A piece of code you
7 min read
How to Create Virtual Machines in Linux Using KVM (Kernel-based Virtual Machine)?
In this tutorial, we are going to see how we can create a virtual machine in Linux using a Kernel-based Virtual Machine. Virtual machines are based on computer architectures and provide the functionality of a physical computer but first, we need to understand what is a kernel-based virtual machine. The Information Technology field is complex it nee
5 min read
Loadable Kernel Module - Linux Device Driver Development
For Linux device drivers, we can use only two languages: Assembler and C. Assembler implements the main parts of the Linux kernel, while C implements the architecture-dependent parts. Uploaded kernel modules are often referred to as kernel modules or modules, but those are misleading names because there are so many types of modules in the world, an
4 min read
How to Upgrade Linux Kernel on CentOS 7
The kernel is a central component of an operating system that manages the operations of the computer and hardware. It basically manages operations of memory and CPU time. It is a core component of an operating system. Kernel acts as a bridge between applications and data processing performed at the hardware level using inter-process communication a
2 min read
How to Compile Linux Kernel on CentOS 7
The kernel is the core of a computer's operating system that has complete control over the system and provides basic services for all other parts. The default kernel available in any distribution cannot be customized. We cannot enable or disable any feature on it. Running a custom-compiled Linux Kernel becomes very helpful in cases when the hardwar
3 min read
Is Linux a Kernel or an Operating System?
Linux is a widely used open-source Unix-like operating system. This is what most of us know. However, Linux is not an operating system. At least not technically. So, in this article, we will discuss if we should call Linux a kernel or an operating system. Kernel and Operating System:Before moving forward with this topic, we should know the kernel a
4 min read
5 Tips to Make a Career as a Linux Kernel Developer
As we all know that Linux kernel is the heart of the Operating System that allows the real Operating System to function. Indeed, the Linux kernel is the most renowned open-source project ever created. Most developers around the world tend to work on GUI (graphical user interface) applications or libraries which are usually written in higher-level l
4 min read
How to View Kernel Messages in Linux | dmesg Command
The Linux kernel is considered as the one of the core components for the Linux operating system. It helps in establishing the communication between the hardware and managed system resources. To monitor and troubleshoot the kernel's interactions with the hardware and software components, the dmesg command comes as well-handy. In this article, we wil
8 min read
How to Check the MySQL Version in Linux
Checking the MySQL version on a Linux system is a fundamental task for database administrators and developers. Knowing the MySQL version is important for troubleshooting, compatibility, and applying the appropriate updates. In this article, we'll explore various methods to easily determine the MySQL version running on your Linux server, whether you
3 min read
Check the OS Version in Linux
When we want to install the Software on our system, first we must know whether our current Operating System is supporting this version of the software or not. In Windows, we can easily check it as Windows is based on a GUI-based Operating System. But we prefer to use the Command line instead of the GUI in an Operating System like Linus/Unix. In thi
4 min read
How to Hide Nginx Server Version in Linux?
Here we will see how to hide the Nginx server version from error pages and the “Server HTTP” response header field in Linux. This is one of the most important security recommendations for your Nginx HTTP and proxy server. The Nginx will show the version on error pages and in the “Server” response header field. Hiding The Nginx version: To hide the
1 min read
How to Find openSUSE Linux Version?
openSUSE is well known for its GNU/Linux-based operating systems, mainly Tumbleweed, a tested rolling release, and Leap, a distribution with Long-Term-Support(LTS). MicroOS and Kubic are new transactional, self-contained distributions for use as desktop or container runtime. Here we figure out which version of the openSUSE Linux distribution is ins
2 min read
How to Find Out Postfix Mail Server Version in Linux?
The most commonly used implementations of SMTP in most Linux distros are Sendmail and Postfix. Postfix is an open-source mail-transfer agent that was originally developed as an alternative to Sendmail and is usually set up as the default mail server. We'll show you how to figure out what version of the Postfix mail system is running on your Linux s
1 min read
How to Update sudo Version on Linux
In the Linux Operating System, we use different administrative commands to control and manage the system. To perform the administrative work on the system, we use sudo as the main primary command. sudo in Linux is the command utility that allows us to execute the commands with superuser privileges. The main goal of the sudo command is to allow non-
6 min read
Compile our own Android Kernel in 5 Simple Steps
The Android kernel helps the applications to communicate with the hardware components of the device. For example: Most of us are familiar with game mode. What it does is instructs the processor and the graphics processing unit to run at their maximum frequencies. Another example is power saver mode. It instructs the processor and the graphics proce
3 min read
What is Terminal, Console, Shell and Kernel?
As a fresher, while learning Linux we get confused with the actual meaning of the terms like-Terminal, Console, Shell, and Kernel. Sometimes we mix up their usage which is technically incorrect so having a clear grasp of what every word actually means and how and where they should be used is very important. 1. Terminal:For those having Linux OS, wh
4 min read
User mode and Kernel mode Switching
In it's life span a process executes in user mode and kernel mode. The User mode is normal mode where the process has limited access. While the Kernel mode is the privileged mode where the process has unrestricted access to system resources like hardware, memory, etc. A process can access I/O Hardware registers to program it, can execute OS kernel
4 min read
How to connect a Local Jupyterlab to a Remote Kernel?
In the era of emerging technologies like Data Analytics, Data Science, Machine Learning, etc., we have seen and come across scenarios, demanding powerful tools that can accelerate and streamline the process of work. One such useful tool that we encountered is JupyterLab. In this article, we will explore the various concepts related to JupyterLab No
7 min read
How to Check Your Ubuntu Version: A Guide
Ubuntu is a Linux distribution built on Debian that is mostly comprised of software that is open-source and free. Ubuntu is officially available in three editions: Desktop, Server, and Core for IoT devices and robots. Canonical, a British corporation, and a group of other developers work on the operating system under a meritocratic governance parad
4 min read
Juumla - Tool Designed To Identify And Scan For Version, Config Files In The CMS Joomla
Juumla is an open-source content management system(CMS). It assists you to build powerful dynamic websites and applications. It has an automatic interface that helps you use its features and functionality to the whole. Juumla tool is an automated tool developed in the Python language which is used to identify the Joomla CMS Version running on the t
2 min read
WPCracker - WordPress User Enumeration and Version Detection Tool
Vulnerability in CMS can be triggered due to an outdated version of CMS or by getting the username information that is related to CMS. This can help to perform a Social Engineering attack. WPCracker is an automated tool developed in the Python Language used to recognize the Version of the WordPress CMS sites. Along with this WPCracker tool supports
2 min read
How to Update Minikube Latest Version?
In the ever-changing landscape of container orchestration, Minikube stands as a visual signal, simplifying the deployment and management of Kubernetes clusters on your local machine While Minikube continues to evolve with new features and enhancements variety, it’s not best practice to just stay up-to-date This is your ticket to unlocking the full
3 min read
Difference Between Arch Linux and Kali Linux
Arch Linux is an open-source Linux-based Operating System that is freely available for use. It belongs to the Pacman-based Linux family. It is a light weighted OS for daily use and could even be used by professionals. It was first released in March 2002. It is a beginner-friendly Linux Operating System. Features of Arch Linux: Minimalist approach:
4 min read
Neofetch In Linux – Snap cool screenshots of your Linux
Neofetch is a fancy, highly customizable, and aesthetic command-line system information screenshot utility tool. Written in the Bash scripting language, it works inside a terminal window, on triggering up the command it by default displays the operating system, software, and hardware of your system on the right side of the column alongside an ASCII
4 min read
Exodus - Copy Linux Binaries From One Linux System
Exodus is an easy-to-implement program, that is used for bundling dependencies, and also helps to effectively copy Linux ELF binaries from one to another machine securely, and this is very handy when you don't have root access, also if there are issues in the availability of the packages in the Linux distribution, Commonly Server oriented distribut
3 min read
Basic CentOS Linux Commands in linux
CentOS is a free and open-source operating system that aims to provide a stable reliable, and community-supported platform for servers and other enterprise applications. In this article, we will be covering CentOS Linux basics commands and functions of CentOS and also we will look into the advanced commands. These CentOS commands allow you to manag
3 min read