• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Check Kernel Version in Linux System

Written by Admin, Updated On May 28, 2020
terminal
how to check the kernel version in linux

The Linux kernel is the core component of Linux operating systems. It manages the system’s resources, and communication between your computer’s hardware and software. In this tutorial, we will show you multiple ways to check the version of Linux kernel running on your system.

Check Kernel Version#

It also maintains the security of your system. There are multiple reasons, to know the version of the kernel which is running on your GNU/Linux operating system.

Using the uname Command#

The uname command used to get system information such as, name version, the Linux kernel architecture, and release.

Run the following command to find out the Linux kernel which is running on your system:

uname -srm
Linux 4.15.0-101-generic x86_64

In output, it shows the Linux kernel is 64-bit and its version is 4.15.0-101.

Using hostnamectl command#

The systemd includes hostnamectl utility and used to change the hostname. It also shows the Linux distribution and kernel version:

hostnamectl
   Static hostname: tecnstuff
         Icon name: computer-vm
           Chassis: vm
        Machine ID: a51c7bf6767de7b511cede805d7c8290
           Boot ID: 6d9c812d57134a51822c77c5e6127e6e
    Virtualization: kvm
  Operating System: Ubuntu 18.04.4 LTS
            Kernel: Linux 4.15.0-101-generic
      Architecture: x86-64

To filter out the Linux kernel version use the grep command:

hostnamectl | grep -i kernel
Kernel: Linux 4.15.0-101-generic

Using /proc/version File#

Information files of system memory, CPU cores, etc. are stored in /proc directory. Information about the running kernel is stored in the /proc/version virtual file.

You can use cat or less to print the contents of the file:

cat /proc/version

The output will look something like this:

Linux version 4.15.0-101-generic (buildd@lgw01-amd64-003) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020

Conclusion#

We have shown you multiple ways to check the version of the Linux kernel running on your system using command line. Same methods will work on all Linux distributions. You can find kernel source code here.

If you have any question or feedback, feel free to leave a comment below.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install R on CentOS 8
Next Article   How to Install Xrdp Server (Remote Desktop) on Ubuntu 20.04

Related Posts

  • How to Install SSH Keys on Ubuntu 22.04

    How to Set up SSH Keys on Ubuntu 22.04

    January 7, 2023
  • How to Install Fail2ban on Ubuntu 22.04

    How to Install and Configure Fail2ban on Ubuntu 22.04

    December 5, 2022
  • How to Enable SSH on Ubuntu 22.04

    How to Enable SSH on Ubuntu 22.04

    December 1, 2022

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook