Commands to check linux kernel version: Guide

  • Last updated: Nov 24, 2024
  • Views: 22
  • Author: Admin

Every Linux operating system is built on top of a kernel, a key component that manages the hardware and coordinates the operation of applications. The kernel version can be important for a variety of reasons: compatibility with hardware, working with specific software, or fixing problems through updates.

In this article, we will look at simple and accessible ways to find out what kernel version is installed on your device. You can quickly get this information using built-in Linux commands.

In this article, all examples are shown on the Centos 8 Stream platform, but don't worry if you have another platform installed, for example Debian or Ubuntu, all commands in the examples below will work equally on all platforms.

 

The first Linux command to find out what version of the kernel you have is to run the command:

$. uname -a

linux version core

Or

$. uname -r

linux version core

As you understand, the uname command displays detailed information on your system.


 

The second way is to look at the /proc/version file.

$. cat /proc/version

linux version core

The /proc/version file contains:

  • Kernel version.
  • The compiler used to build the kernel (usually GCC).
  • Date and time of kernel build.

 

The third way is to look at the contents of the osrelease file in the /proc/sys/kernel directory.

$. cat /proc/sys/kernel/osrelease

linux version core

This file provides only brief information about the kernel version, without additional data about the compiler or build time. It is useful for quickly getting the exact version number of the linux kernel.


 

The fourth way is to see what kernel versions are installed in the system.

$. sudo rpm -q kernel

linux version core


 

In summary, knowing your Linux kernel version is an important step to understanding your current system configuration. This information can be useful when configuring hardware, installing software, or upgrading your system.

We've looked at several ways to check the kernel version, from simple commands in the terminal to studying system logs. The choice of method depends on your preferences and situation, but all of them allow you to quickly get the data you need.

Regular kernel updates help improve system stability, security, and performance. Remember to keep your version up to date and use reliable sources for updates.

 

SIMILAR ARTICLES