3 Ways to Check Linux Kernel Version in Command Line

Brief: Wondering which Linux kernel version your system uses? Here are several ways to check kernel version in Linux terminal.

Various ways to check Linux kernel version

You may find yourself in a situation when you need to know the exact Linux kernel version being used on your system. Thanks to the powerful Linux command line, you can easily find that out.

In this article, I’ll show you various methods to know kernel version along with what those numbers actually mean. If you prefer videos, here’s a quick one. Don’t forget to subscribe to our YouTube channel for more Linux tips.

How to find Linux kernel version

I am using Ubuntu 16.04 while writing this article. But these commands are generic and can be used on Fedora, Debian, CentOS, SUSE Linux or any other Linux distribution.

1. Find Linux kernel using uname command

uname is the Linux command to get system information. You can also use it to know if you are using a 32-bit or 64-bit system.

Open a terminal and use the following command:

uname -r

Checking Linux kernel version in command line

The output  will be something similar to this:


This means that you are running Linux kernel 4.4.0-97 or in more generic terms, you are running Linux kernel version 4.4.

But what do other digits mean here? Let me explain it to you:

  • 4 – Kernel version
  • 4 – Major revision
  • 0 – Minor revision
  • 97 – Bug fix
  • generic – distribution specific string. For Ubuntu, it means I am using the desktop version. For Ubuntu server edition, it should be server.

You can also use uname command with option -a. This will provide more system information if you want that.

uname -a

Checking Linux kernel version in command line

The output of the command should like this:

Linux itsfoss 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Let me explain the output and give it a meaning:

  • Linux – Kernel name. If you run the same command on BSD or macOS, the result will be different.
  • itsfoss – hostname
  • 4.4.0-97-generic – Kernel release (we just saw that)
  • #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 – This means that Ubuntu compiled 4.4.0-97-generic 120 time. Last compilation timestamp is also there.
  • x86_64 – Machine architecture
  • x86_64 – Processor architecture
  • x86_64 – Operating system architecture (You can run a 32 bit OS on a 64-bit processor)
  • GNU/Linux – Operating system (and no it won’t show the distribution name)

I’ll save you from information overload. So let’s see other commands to find Linux kernel version.

2. Find Linux kernel using /proc/version file

In Linux, you can also find the Linux kernel information in the file /proc/version. Just look at the content of this file:

cat /proc/version

Checking Linux kernel version in command line

You’ll see an output similar to what we saw with uname.

Linux version 4.4.0-97-generic (buildd@lcy01-33) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017

You can see the kernel version 4.4.0-97-generic here.

3. Find Linux kernel version using dmesg commad

dmesg is a powerful command used to write the kernel messages. It is also very useful in getting system information.

Since dmesg provides quite an awful lot of information, you should use a command like less to read it. But since you are here just to check Linux kernel version, grepping on Linux should give the desired output.

dmesg | grep Linux

Checking Linux kernel version in command line

The output will have a few lines but you should be able to identify the Linux kernel version there easily.

[ 0.000000] Linux version 4.4.0-97-generic (buildd@lcy01-33) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 (Ubuntu 4.4.0-97.120-generic 4.4.87)
[ 0.182880] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[ 1.003861] Linux agpgart interface v0.103
[ 1.007875] usb usb1: Manufacturer: Linux 4.4.0-97-generic xhci-hcd
[ 1.009983] usb usb2: Manufacturer: Linux 4.4.0-97-generic xhci-hcd
[ 5.371748] media: Linux media interface: v0.10
[ 5.399948] Linux video capture interface: v2.00
[ 5.651287] VBoxPciLinuxInit

How do you check Linux kernel version and other information?

Among the three ways discussed here, I use uname all the time. It is more convenient.

What about you? Which command do you prefer to get Linux kernel information?

0 (0)
Article Rating (No Votes)
Rate this article
There are no attachments for this article.
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
How To Ping Specific Port Number
Viewed 1056 times since Mon, Jun 1, 2020
Linux File Systems (mkfs, mount, fstab) ext4
Viewed 1143 times since Sat, Jun 2, 2018
RHEL: Resize/disable /dev/shm filesystem
Viewed 4571 times since Sun, May 27, 2018
RHEL7: Create and configure LUKS-encrypted partitions and logical volumes to prompt for password and mount a decrypted file system at boot.
Viewed 2717 times since Mon, Aug 6, 2018
Managing temporary files with systemd-tmpfiles on Red Hat Enterprise Linux 7
Viewed 296 times since Sun, Nov 22, 2020
Install OpenVPN On CentOS / RHEL 7
Viewed 735 times since Fri, May 15, 2020
Moving SSL Certificate from IIS to Apache
Viewed 683 times since Mon, Feb 18, 2019
Check a Website Availability from the Linux Command Line
Viewed 675 times since Mon, Feb 18, 2019
debian Install a newer kernel in Debian 9 (stretch) stable
Viewed 710 times since Sun, Sep 23, 2018
RHEL: XFS basic operations
Viewed 1902 times since Sat, Jun 2, 2018