How to check your Linux kernel version

David Rutland
David Rutland Linux

The Linux kernel is the core component of your distro, and controls everything from CPU allocation to the drivers for your keyboard, mouse, and monitors.

Work on the kernel is constantly ongoing, with new mainline kernels dropping every few weeks to add bugfixes, greater compatibility, and smoother operation.

Not every kernel is right for every system, and some kernels are known to have issues which can cause problems with hardware, or with the rest of your system.

It's always a good idea to know which Linux kernel you're running, as this can help you to diagnose problems, and help you find out if there are performance gains to be made by switching kernel.

How Linux kernels are numbered

man and woman looking perplexed at a laptop

Depending on how far back in time you want to travel, the Linux kernel numbering system can be quite confusing, as there have been multiple different schemes over the years. Unless you've uncovered an ancient x286 machine in your loft, only the most recent one is likely to really matter to you.

Version 0.01 was released in 1991 and progressed at irregular intervals until release 1.0. During this period there was no release schedule, and version numbers jumped and skipped arbitrarily without explanation.

After version 0.95, Linux adopted Semantic versioning along with indicators of whether the change was major or minor. Taking kernel version 1.0.9 as an example, the "1" indicates the major version - it's a huge difference from the "0" series kernels. The second digit, "0" is the minor version, meaning that some features have been added or changed, but it's not completely different from any other kernel in the "1" range. The last digit, "9", shows the revision version.

Between Kernel versions 2.0 and 2.6, Linux adopted an odd/even release scheme for minor versions. Odd numbers, like.2.1, indicate development or unstable releases, and odd number, eg: 2.4 are stable.

To make things more complicated, a fourth digit set was introduced starting with version 2.4, indicating the patch version of the kernel. The version number 2.4.27.10 would tell you that its the 10th patch to the 27th revision of the fourth minor version of the second major kernel release.

If you think this sounds unnecessarily complicated, it is, and this versioning system was dropped with version 2.6, which itself was around for an epic eight year period between 2003 and 2011.

Recent editions of the Linux kernel have reverted to a variant of the version used between 1.0 and 2.4. The first number indicates a major release, the second number is the minor release, and the third number is the revision.

There's no longer any fundamental or technological break between major release versions, and the number is upgraded when the minor number reaches 20, or Linus Torvalds decides the number is close enough.

Bug fix versioning may be indicated by a dash ("-"), and versions ending in -rcX are kernel previews and are not suitable for everyday use.

Additionally, different distros may run their own kernels, and have custom names and additions.

You can find out which kernel version you have using the terminal. Open the terminal by pressing Ctrl + Alt + T or by selecting it from your system menu.

Find your Linux kernel version with Neofetch

neofetch showing linux kernel version

Neofetch is a fast, highly customisable system info script utility, and is the most stylish way of grabbing your kernel version info, along with a lot of other information.

You can install it on Debian-based systems with:

sudo apt install neofetch

On Arch with:

sudo pacman -S neofetch

Or for the Fedora family:

sudo dnf install neofetch

Run Neofetch by entering:

neofetch

You'll see a wealth of information including hostname, OS version, screen resolution, your distro logo, and, of course the kernel version.

To use Neofetch to see the kernel version without ancillary information, enter:

neofetch kernel

Find your Linux kernel version with uname

output of uname -r showing kernel version

The system command, uname, is used to print system information to the terminal. Entering it without options will tell you that you're using Linux. Adding the "-r" switch will print the kernel release as standard output.

Entering:

uname -r

Will show you the kernel version

Find your Linux kernel version with dmesg and grep

The Linux kernel generates logs for everything it does, and dmesg is a tool you can use to access the kernel log.

Running the command on its own will generate a landslide of information, but fortunately, you can use grep to search through it for your Linux kernel version.

Enter the following command in your Linux terminal:

sudo dmesg | grep Linux

You'll see multiple lines of output, with your kernel version on the first line.

Find your Linux Kernel version in the virtual filesystem

Everything's a file on Linux, and everything to do with the kernel currently in memory is kept it the /proc directory.

The version file relates, as you might imagine, to kernel version information. Use the cat command to see its contents:

cat /proc/version

There are a bunch of ways to check your Linux kernel version

Whichever method you choose, these methods are guaranteed to show you which Linux kernel version you're currently running. You should keep an eye on new kernel releases, but don't be in too much of a hurry to upgrade. The latest kernel version may not be a good fit for your system, so do your research first.