10 Ways to Check Which Linux Version You’re Running
Whatsapp Pinterest
Advertisement

Which version of Linux are you running? Ubuntu? Arch? Red Hat? No, that’s not what you really want to know, is it? What you want is the actual Linux version, or even the Linux kernel version.

After all, it’s not displayed anywhere, so how could you know? Here are nine commands to help check the Linux version and the Kernel version of your current distro.

OS Version or Kernel: What’s the Difference?

The first thing to check is whether you’re looking for the OS version or the Kernel version.

For example, if you’re using Ubuntu, you might want to check the version of the operating system. It could be 19.04, but is there a subsequent built number?

On the other hand, you may need to know the Linux kernel version. The Kernel is the core of Linux, the code that lets the software communicate with the hardware. Our guide to the Linux kernel What Is a Kernel in Linux and How Do You Check Your Version? What Is a Kernel in Linux and How Do You Check Your Version? Linux is an operating system, right? Well, not exactly! It's actually a kernel. But what is the Linux kernel? Read More will explain this in more detail.

Show Your Linux Version on the Desktop

In addition to the nine command line options below, you can also check your Linux version from the desktop. This will differ depending on the desktop environment and operating system. However, if you want to check your Ubuntu version, your CentOS version, or whatever, without the command line, you can.

For example, to check your Ubuntu version from the desktop, go to System Settings > Details. Here, you’ll see the distro version you’re running. While this won’t give you as much detail as the command line, it is enough to confirm your Linux version.

How to Check Your Linux Distro and Kernel Version

As you’ll have gathered, the desktop will only give you the basic information concerning your Linux version. For more details, you’ll need to rely on the command line.

Various commands can be used to reveal interesting information about your Linux system. Along with the details of your Linux version, you can find out about the distribution release, codename, and Kernel. This information can prove useful for several reasons. You night need it for troubleshooting, for example, or simply to check if your Linux version has updated.

The following nine commands let you check your Linux version and Kernel version from the terminal.

1. Easily Show Your Linux OS Version With cat /etc/os-release

Check your Linux version with osrelease

Your first option is to check the os-release file in the /etc/ directory. This will provide quite a detailed account of your Linux operating system’s version. We can check this quickly using the cat (concatenate) command, which can be used to display or create new files.

cat /etc/os-release

Our example was tested with Ubuntu. Here, the OS name, full version, version ID, and codenames are listed.

2. Another Option to Check Your Linux Version: cat /etc/*release

Check your Linux version

Slightly more information can be gathered using the *release file instead. This displays all information from files ending with the word “release” in the /etc/ directory, concatenated into a single output.

cat /etc/*release

The output is largely the same as previously, but with additional distribution information.

3. Get Your Linux Version: cat /etc/issue

use the issue command to check your Linux version

For a more straightforward response to your request for a Linux OS version number, try this cat command.

cat /etc/issue

Here you’ll see the distro name and version. Simple!

4. Find Your Linux Distro Version: lsb_release -a

Use the lsb_release command to check your Linux version

The lsb_release command will display Linux Standard Base (lsb) information about your Linux distro.

lsb_release -a

Notice the name of the distributor, as well as the distro name, release, and codename. Again, this is a straightforward command with compact, clear results.

5. Display the Linux Kernel Version With hostnamectl

Check your version with hostnamectl

The hostnamectl command can be used to change the system hostname but used alone will display Linux version details.

hostnamectl

Using the command displays the hostname of the device, along with machine ID, and architecture. You’ll also find the Linux version and Linux kernel version displayed with this command.

6. Use uname -r to Check the Linux Kernel Version

Check your Linux kernel version with uname -r

Although the previous command displays details about the Linux kernel version, if that’s all want, try uname -r instead.

uname -r

This will output the version number for your distro’s Linux kernel. There’s no context to this, just the version number.

7. More Linux Kernel Details With uname -mrs

Check your inux kernel version with uname

Additional information about your current distro’s Linux version can be found by expanding the -r switch to -mrs.

languaguname -mrs

This has nothing to do with your wife or mother. Rather, the -mrs command provides information about the Kernel name and hardware version. In our example, we’ve run the command on a Raspberry Pi 4, which displays armv71. A 32-bit or 64-bit Intel/AMD-based architecture would show x86_64 instead.

8. Display More Linux Kernel Version Information: uname -a

Check your Linux kernel version with uname -a

Even more information can be displayed about your Linux kernel with the -a command extension.

uname -a

Using this, you’ll see the device name, Linux kernel version, release date, architecture, and full OS name (typically GNU/Linux Why Hardly Anyone Calls Linux "GNU/Linux" Why Hardly Anyone Calls Linux "GNU/Linux" You're interested in Linux and have read a few blog posts. Along the way, you've come across a funny name: GNU/Linux. But what does this mean? Read More ).

9. Detailed Linux Kernel Information With cat /proc/version

Check your Linux kernel version in the command line

The final option to check your Linux kernel version is another cat command. This uses the version file in the /proc directory.

cat /proc/version

You’ll find the version number of your current Linux kernel, compiled from information from the /proc/sys/kernel/ostype, /proc/sys/kernel/osrelease, and /proc/sys/kernel/version files. As noted earlier, the cat command concatenates information from various files, which is what is happening here.

Now You Know What Version of Linux You’re Running

With nine command line options and the details you can find in your distro’s chosen desktop environment, you should now know how to find your Linux OS version. Checking your Linux distro is easy—if you know how! Similarly, tracking down the details of your Linux kernel version should now also be clear.

Want to do more in the Linux terminal? Become a Linux command line master with these tips and tricks Become a Linux Command Line Master With These Tips and Tricks Become a Linux Command Line Master With These Tips and Tricks Whether you're brand new to Linux, or a seasoned Linux veteran, the command line offers a bevy of uses. Try these tips for mastering the command line. Read More .

Explore more about: Command Prompt, Linux Commands, Linux Kernel, Terminal.

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Steve
    August 29, 2019 at 12:50 am

    Another good script is neofetch. It usually needs to be installed, typically on a denial based system it can be done with a command like: sudo apt install neofetch

    It's a bash script and recognizes many oses including Linux, BSD, macOS, and Windows. It provides a great deal of information about your operating system and hardware.