Skip to main content

Command Palette

Search for a command to run...

How to Display Linux Version

Updated
6 min read

When working with Linux, knowing your system’s version is essential. Whether you’re troubleshooting, installing software, or just curious, displaying the Linux version helps you understand your environment better. You might think it’s complicated, but it’s actually quite straightforward.

In this article, I’ll guide you through several easy ways to check your Linux version. You’ll learn commands that work across different distributions and how to interpret the results. By the end, you’ll feel confident finding your Linux version anytime you need it.

Why Knowing Your Linux Version Matters

Understanding your Linux version is more than just curiosity. It helps you:

  • Ensure software compatibility.
  • Follow accurate troubleshooting steps.
  • Keep your system secure with proper updates.
  • Identify your distribution and kernel details.

Linux comes in many flavors, like Ubuntu, Fedora, Debian, and CentOS. Each has its own versioning system. Knowing exactly which one you’re running makes managing your system easier.

Using the uname Command to Display Linux Version

One of the simplest ways to check your Linux version is with the uname command. It provides information about your system’s kernel.

To see the kernel version, open your terminal and type:

uname -r

This command outputs something like:

5.15.0-70-generic

Here’s what it means:

  • 5.15.0 is the kernel version.
  • 70 is the patch level.
  • generic indicates the kernel flavor.

If you want more detailed information, use:

uname -a

This shows:

  • Kernel name
  • Hostname
  • Kernel release
  • Kernel version
  • Machine hardware name
  • Processor type
  • Hardware platform
  • Operating system

For example:

Linux mypc 5.15.0-70-generic #77-Ubuntu SMP Fri Mar 18 12:00:00 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux

This tells you the kernel and some system details, but it doesn’t specify the Linux distribution.

Checking Distribution Information with /etc/os-release

To find out your Linux distribution and version, the file /etc/os-release is your best friend. It contains detailed info about your OS.

Run this command:

cat /etc/os-release

You’ll see output like:

NAME="Ubuntu"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 22.04.2 LTS"
VERSION_ID="22.04"
HOME_URL="https://www.ubuntu.com/"

This tells you:

  • The distribution name (Ubuntu).
  • The version number (22.04.2 LTS).
  • The codename (Jammy Jellyfish).
  • The distribution family (debian).

This method works on most modern Linux distributions, including Fedora, Debian, and CentOS.

Using lsb_release Command for Distribution Details

Another handy tool is lsb_release. It provides Linux Standard Base and distribution-specific information.

To use it, type:

lsb_release -a

You’ll get output like:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

This command is user-friendly and gives a clear summary of your Linux version.

If you get an error saying lsb_release is not found, you can install it:

  • On Debian/Ubuntu:

    sudo apt-get install lsb-release
    
  • On Fedora:

    sudo dnf install redhat-lsb-core
    

Viewing Kernel Version with hostnamectl

The hostnamectl command is primarily for managing your system’s hostname, but it also shows OS and kernel info.

Run:

hostnamectl

You’ll see output like:

   Static hostname: mypc
         Icon name: computer-laptop
           Chassis: laptop
        Machine ID: 1234567890abcdef
           Boot ID: abcdef1234567890
  Operating System: Ubuntu 22.04.2 LTS
            Kernel: Linux 5.15.0-70-generic
      Architecture: x86-64

This gives you a neat summary of your Linux version and kernel in one place.

Checking Version Using cat /proc/version

The /proc/version file contains kernel version and build info. It’s a quick way to get kernel details.

Run:

cat /proc/version

Example output:

Linux version 5.15.0-70-generic (buildd@lcy02-amd64-030) (gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1)) #77-Ubuntu SMP Fri Mar 18 12:00:00 UTC 2026

This shows the kernel version, compiler used, and build date.

Using GUI Tools to Check Linux Version

If you prefer graphical interfaces, most Linux desktop environments have system info tools.

  • GNOME: Go to Settings > About. You’ll see OS name, version, and hardware info.
  • KDE Plasma: Open System Settings > About System.
  • XFCE: Use Settings > About XFCE or install tools like hardinfo.

These tools are helpful if you’re new to Linux or want quick access without the terminal.

Summary Table of Commands to Display Linux Version

CommandDescriptionOutput Example
uname -rKernel version5.15.0-70-generic
uname -aDetailed kernel and system infoLinux mypc 5.15.0-70-generic ...
cat /etc/os-releaseDistribution name and versionUbuntu 22.04.2 LTS
lsb_release -aLSB and distro infoDistributor ID: Ubuntu
hostnamectlOS and kernel infoUbuntu 22.04.2 LTS, Kernel 5.15
cat /proc/versionKernel version and build infoLinux version 5.15.0-70-generic

Troubleshooting Common Issues

Sometimes, commands might not work as expected. Here’s what to do:

  • lsb_release not found: Install the package using your distro’s package manager.
  • No /etc/os-release file: Older or minimal distros might lack this file. Try lsb_release or check /etc/issue.
  • Permission denied: Most commands don’t require root, but if you get permission errors, try prefixing with sudo.

How to Display Linux Version in Scripts

If you want to automate version checks in scripts, use commands that output clean, parseable text.

Example bash snippet:

#!/bin/bash
if [ -f /etc/os-release ]; then
  . /etc/os-release
  echo "You are running $NAME version $VERSION"
else
  echo "Cannot detect Linux version"
fi

This script sources /etc/os-release and prints the distribution name and version.

Conclusion

Now you know several easy ways to display your Linux version. From simple commands like uname -r to detailed info with lsb_release -a and /etc/os-release, you have plenty of options. Whether you prefer the terminal or GUI tools, checking your Linux version is quick and straightforward.

Knowing your Linux version helps you manage your system better and ensures you get the right software and updates. Next time you need to find your Linux version, just pick the method that suits you best and get the info you need in seconds.

FAQs

How do I check my Linux kernel version?

Use the command uname -r in the terminal. It shows the kernel version currently running on your system.

What command shows my Linux distribution and version?

cat /etc/os-release or lsb_release -a provide detailed distribution name and version information.

Can I check Linux version without using the terminal?

Yes, most desktop environments have system info tools in their settings menus that display Linux version details.

What if lsb_release is not installed?

You can install it using your package manager, for example, sudo apt-get install lsb-release on Ubuntu.

Does uname -a show the Linux distribution?

No, uname -a shows kernel and system info but not the distribution name or version. Use /etc/os-release for that.

More from this blog

L

LinuxBloke | Linux Tips, Tricks & Troubleshooting

672 posts