How to Check Kernel Version in Linux

Muhammad Husnain Feb 02, 2024
  1. Use the uname -r Command to Check Kernel Version in Linux
  2. Use the Cat Command to Check Kernel Version in Linux
  3. Use the hostname Command to Check Kernel Version in Linux
How to Check Kernel Version in Linux

The kernel is an integral part of the Linux operating system that interfaces between the computer hardware and software processes. The main responsibilities of the Linux kernel are resource management such as memory, CPU, drivers, and system calls.

The Kernel manages memory and records of each file in Kernel space that is Kernel’s working area. The Linux kernel is also responsible for system security and communication between software and hardware components.

Bash has many commands to find Linux Kernel, such as uname -r, cat /proc/version, and hostnamectl | grep Kernel.

Use the uname -r Command to Check Kernel Version in Linux

The command below will print the Kernel name, Kernel version, and other system information.

uname -r

Output:

5.4.0-54-generic

Description of the output:

$$ 5 \to Kernel \ Version\\ 4 \to Major \ Revision\\ 0 \to Minor \ Revision\\ 54 \ \to Patch \ Number\\ generic \to Addtional \ information \ of \ Kernel $$

Use the Cat Command to Check Kernel Version in Linux

The command below will print the Kernel name, Kernel version, Linux version, time, and date.

cat /proc/version

Output:

Linux version 5.4.0-54-generic (buildd@lcy01-amd64-024) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #60-Ubuntu SMP Fri Nov 6 10:37:59 UTC 2020

Use the hostname Command to Check Kernel Version in Linux

The command below will also print the Kernel name, Kernel version, and other system information.

hostnamectl | grep Kernel

Output:

Kernel: Linux 5.4.0-54-generic
Muhammad Husnain avatar Muhammad Husnain avatar

Husnain is a professional Software Engineer and a researcher who loves to learn, build, write, and teach. Having worked various jobs in the IT industry, he especially enjoys finding ways to express complex ideas in simple ways through his content. In his free time, Husnain unwinds by thinking about tech fiction to solve problems around him.

LinkedIn