How to Check Linux OS Version on Any Distro

How to Check Linux Version (OS and Kernel)

 There are many Linux distributions available today, such as Ubuntu, Debian, Fedora, and CentOS. Knowing how to check the OS version in Linux is an important skill for every user, and here at Linux Simplify, we emphasize how crucial this knowledge is for managing your system effectively. Understanding the OS version you are running is essential for keeping your system updated with security patches, ensuring software compatibility, and helping with troubleshooting.

What is Version Linux?

A Linux distribution is an operating system built from the Linux kernel, GNU libraries, and various software packages. In this guide, you will learn several simple ways to check your Linux version using the terminal so you can keep your system up-to-date and avoid potential security risks.

Linux itself is a kernel the core component of the operating system that acts as a bridge between hardware and software. When discussing a Linux version, we are referring to two different things: the Linux kernel version and the Linux distribution version. The Linux kernel was first developed by Linus Torvalds in 1991, and new stable releases appear roughly every 9–10 weeks, offering improvements and better hardware support.

A Linux distribution (or distro) is a complete operating system built around the Linux kernel, including GNU libraries, tools, a package manager, a desktop environment, and additional software. Some popular distributions include Ubuntu, Fedora, Debian, CentOS, and Kali Linux. Each distro releases its versions under the open-source GNU GPL license. Because Linux is open-source, more than 100 distributions exist today.

To avoid confusion, remember:

  • Distribution is the complete Linux-based operating system.
  • Version is a specific release of that distribution, often tied to new features and security updates.

When you access a Linux system for the first time, checking the OS version helps you identify the distro and determine which package manager and commands are appropriate for your environment.

How to Check the Linux OS Version Using Terminal Commands

The terminal is the most accurate and universal way to check your Linux version. Below are several methods that work across almost all Linux distributions, along with detailed explanations of where the version information appears in each command.

1) Checking Through the /etc/os-release File

Check os version in Linux

/etc/os-release is a standard text file containing distribution identification data.

Command:

cat /etc/os-release

Example output:

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"

Where the Linux version appears:

  • VERSION → full distro version
  • PRETTY_NAME → user-friendly version (recommended)
  • VERSION_ID → numeric version (for scripts)

This is one of the most reliable sources for distro information.

2) Checking the Linux Version Using lsb_release

The /etc/os-release file

lsb_release displays distribution data in a standardized format.

Full information:

lsb_release -a

Example output:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

Where the version appears:

  • Description → readable name + version
  • Release → numeric version

Simplified version only:

lsb_release -d

3) Using the hostnamectl Command

On systems using systemd, hostnamectl displays OS and kernel details along with hostname information.

Command:

hostnamectl

Example output:

Operating System: Ubuntu 20.04.1 LTS
Kernel: Linux 5.4.0-42-generic
Architecture: x86-64

Where the version appears:

  • Operating System → distro version
  • Kernel → kernel version

Useful when you want both distro and kernel info together.

4) Using the uname Command (Kernel Version Only)

uname shows kernel details. It does not provide the distribution version.

Full details:

uname -a

Kernel version only:

uname -r

Where the version appears:

  • uname -r → Linux kernel version (e.g., 5.4.0-42-generic)

Remember: kernel version ≠ distribution release.

5) Checking the /etc/issue File

/etc/issue contains a pre-login banner displayed before authentication.

Command:

cat /etc/issue

Possible output:

Ubuntu 20.04.1 LTS \n \l

Where the version appears: If your distro includes it, the version appears directly in the text. However, this file is not standardized and may not always contain version details.

Conclusion

Knowing your Linux version is a fundamental skill for maintaining system security, installing compatible software, and troubleshooting effectively. You can use several terminal commands to check the version, such as /etc/os-release, lsb_release, hostnamectl, uname, and /etc/issue, each revealing different aspects of your Linux environment.

As Linux continues to expand across hundreds of distributions, understanding how to identify the distro and version you are running helps you use your system more efficiently and confidently.

Post a Comment for "How to Check Linux OS Version on Any Distro"