Categories: Linux

Kernel Version in Linux [Easy Way to Check]

Kernel version in Linux can be checked easily. 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.

In this tutorial, we’ll show you several different ways to find out what version of Linux kernel is running on your system.

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:

$ uname -srm
Output

Linux 4.15.0-54-generic x86_64 

The output above shows that the Linux kernel is 64-bit and its version is 4.15.0-54, where:

  • 4 – Kernel Version.
  • 15 – Major Revision.
  • 0 – Minor Revision.
  • 54 – Patch number.
  • generic – Distribution specific information.

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:

$ hostnamectl
Output

   Static hostname:  linuxize.localdomain
          Icon name: computer-laptop
            Chassis: laptop
         Machine ID: af8ce1d394b844fea8c19ea5c6a9bd09
            Boot ID: 15bc3ae7bde842f29c8d925044f232b9
   Operating System: Ubuntu 18.04.2 LTS
             Kernel: Linux 4.15.0-54-generic
       Architecture: x86-64 

You can use the grep command to filter out the Linux kernel version:

$ hostnamectl | grep -i kernel
Output

 Kernel: Linux 4.15.0-54-generic 

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:

$ cat /proc/version
Output

Linux version 4.15.0-54-generic (buildd@lgw01-amd64-014) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #58-Ubuntu SMP Thu Oct 24 09:55:24 UTC 2019 

Kernel Version in Linux: Conclusion

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, Arch Linux, Fedora, CentOS, Red Hat, Ubuntu, Kali Linux, OpenSUSE, Linux Mint, and more.

Arslan ud Din Shafiq

Alibaba Cloud MVP, Alibaba Cloud Technical Author, Dzone MVB, Software Engineer, Software Developer, Software Designer, Web Engineer, Web Developer, Web Designer, Database Designer, Database Developer, Cloud Computing Specialist, Linux Expert, Servers, 3D Modeling, Blogger, Facebook Map Editor, Google Map Editor

View Comments

  • The above writing was excellent. I stumble on it very exciting and I will certainly forward this to my buddies on the net. Anyway, thanks for sharing this.

Recent Posts

How To Set Up Secure Nginx Server Blocks on Ubuntu 22.04

NGINX Server Nginx, a popular open-source web server, excels at handling high traffic websites efficiently.… Read More

5 hours ago

The Web Server Showdown: Nginx vs. Apache, LiteSpeed, Caddy, and Beyond

In the realm of web hosting, choosing the right web server is paramount. It acts… Read More

5 hours ago

Linear guidance systems

Are indispensable for ensuring smooth, precise linear motion in many industrial applications. Whether in robotics,… Read More

2 months ago

Cyber Attack Statistics – Identifying Vulnerabilities and Strengthening Defenses

Cyber attacks are becoming more frequent, complex, and damaging. They can disrupt critical operations and… Read More

3 months ago

Empowering Cybersecurity in 2024 with XDR for Comprehensive Threat Detection and Response

With the rise of new threats and the increasing complexity of IT environments, organizations need… Read More

3 months ago

Facade Design Pattern: Simplifying Complex Systems

1. Introduction In software design, managing complex systems can be challenging. The Facade Design Pattern… Read More

4 months ago