Looking to check what Linux Operating System you’re using or the Linux kernel version?

Linux represents a collection of open-source operating systems built around the Linux kernel. These operating systems are known as Linux Distributions, and some of the most popular ones are Debian, Ubuntu, Fedora, CentOS, Arch Linux and OpenSUSE.

Whether you’ve just spun up a server, or simply forgotten your distro or kernel, these things are good to keep in mind for potential software compatibility issues or security patches.

Check Linux Distribution Name, Version & Kernel

To find the Linux operating system’s name, version or kernel:

  1. Open up a terminal (on desktop) or log in via SSH (on a remote server)
  2. Run any of the following commands to check the Linux OS version details:

  1. To check the Linux Kernel version, run one of the following commands:

Let’s explore each of the commands a little more in depth.

Check Linux OS Version Using “cat /etc/os-release”

A reliable way to check your Linux OS name and version is checking the contents of the /etc/os-release file.

This command works on multiple distributions. In this guide we’re testing it on CentOS, Debian and Linux Mint (which is based on Ubuntu).

As you’ll see, the other commands may not work on expected on every distro.

Let’s check the output of this command on the distros mentioned above:

CentOS

Debian

Linux Mint

Check Linux OS Version Using “cat /etc/issue”

Again, we’ll use the cat command, to check the contents of a file. In this case, we’re checking the contents of the /etc/issue file, which contains system identification text:

CentOS

Debian

Linux Mint

Check Linux OS Version Using the “lsb_release” Utility

lsb_release is a utility that displays Linux Standard Base information about the Linux distro. Although it is useful for easily displaying version information in a straightforward manner, it’s not always installed by default.

Let’s see for ourselves:

CentOS

Debian

Linux Mint

Check Linux OS Version Using “hostnamectl”

hostnamectl is a command that lets you display the hostname of the machine, but you can also use it to check a few more details, among them being your OS version and kernel:

CentOS

Debian

Linux Mint

Check Linux Kernel Using “cat /proc/version”

To check our Linux kernel version, we can use the cat command to check the contents of the /proc/version file:

CentOS

Debian

Linux Mint

Check Linux Kernel Using “uname”

Lastly, we can check our Linux kernel using the uname utility, which is short for unix name.

With it, you can check the name, version, kernel and other details about the current machine and operating system.

To see all the options, just run:

Output:

We’ll just use it to check the Linux kernel, in this guide:

CentOS

Debian

Linux Mint

Conclusion

In this guide we’ve explored several ways to check our Linux OS name, version, kernel, and other details.

If you’ve encountered any issues or you consider that some aspects of this guide should be corrected, then feel free to contact us via the comments or any other means and we’ll get back to you as soon as possible.


Vlad

Tech Support