Whether you are setting up a new server, troubleshooting a package conflict, or verifying compatibility before an update, knowing how to check the Linux version on your system is something you will need more than once. The answer depends on what you are actually looking for — the distribution name, its release number, or the kernel beneath it. These are separate things, and different commands return different parts of that picture.
What “Linux Version” Actually Means
The phrase “Linux version” covers two different things. Your distribution — Ubuntu, Fedora, Debian, Mint, or RHEL — is the named OS package with its own release schedule and software repositories. The kernel is the underlying software layer that manages hardware, separate from the distribution name entirely.
A command like uname -r only returns kernel data. lsb_release -a returns distribution details. Some commands show both at once. Knowing which one you need saves time and avoids running the wrong tool.
How to Check Linux Version: Six Methods
There are six reliable ways to check the Linux OS version or kernel from the command line. Which one works best depends on your distribution and what information you need.
lsb_release -acat /etc/os-releaseuname -rhostnamectlcat /etc/issuecat /proc/version1. Check Linux Version with lsb_release
lsb_release -a
LSB stands for Linux Standard Base. This command returns the distributor ID, description, release number, and codename in a single output. It works across Ubuntu, Debian, Fedora, and most common distributions without additional configuration.
If the command is not found, the tool is not installed by default on that system. The full list of available output flags documents how to filter for individual fields if you only need the release number or distributor ID. Not all distributions ship it, so having a fallback is worth knowing.
2. Check Linux Version Using /etc/os-release
cat /etc/os-release
This file exists on nearly every modern Linux system and outputs structured data: OS name, version, ID, and additional metadata. It works on Ubuntu, Debian, Fedora, Red Hat, CentOS, and Alpine without needing any extra tools installed, which makes it one of the most portable options.
The os-release file format specification documents each variable in detail, useful when you need to parse specific fields inside a shell script. If lsb_release is unavailable, start here.
3. Check Linux Kernel Version with uname
uname -a
This returns a full line of system information covering the kernel name, hostname, kernel release number, compile date, and CPU architecture. To get just the kernel version, use the shorter form:
uname -r
Here is what each field in uname -a output means:
| Field | Example Value | Meaning |
|---|---|---|
| Kernel name | Linux | The kernel type |
| Hostname | server01 | Machine name |
| Kernel release | 5.14.0-162.el9.x86_64 | Kernel version number |
| Compile info | #1 SMP Tue Nov 15 2022 | When the kernel was built |
| Architecture | x86_64 | CPU type (64-bit) |
| OS | GNU/Linux | Full OS name |
The complete uname flag reference covers every available option, including -m for machine hardware type and -p for processor architecture — both useful when selecting the right software package to download.
4. Using hostnamectl to Check Linux Version
hostnamectl
On Systemd-based systems, this is the fastest single command for seeing both the OS distribution name and kernel version together. Look for the “Operating System” and “Kernel” lines in the output. It pulls from Systemd logs tied to the machine’s hostname.
The documentation for controlling the system hostname explains additional subcommands for querying and setting hostname-related settings. One limitation: this command does not work on older distributions or systems that do not use Systemd as their init system.
5. Using the /etc/issue File
cat /etc/issue
This file contains the message shown to users before a login prompt. It usually holds a short OS identification string — a quick read when you do not need full distribution metadata. The output is brief but consistent on most systems.
On some distributions, /etc/issue contains placeholder text rather than actual version data. In those cases, /etc/os-release is the more reliable choice.
6. Using cat /proc/version
cat /proc/version
This reads directly from the proc virtual filesystem and combines content from three kernel files: ostype, osrelease, and version. The output includes the kernel version and build metadata — a solid fallback when other commands are unavailable, since it works regardless of what is installed on the system.
The cat command reference for concatenating files to standard output covers how to chain file reads and filter output in scripts, which is practical when pulling data from multiple proc entries at once.
Quick Reference: Linux Version Commands
| Goal | Command |
|---|---|
| See both OS name and kernel | hostnamectl |
| Distribution details with codename | lsb_release -a |
| Standard OS info file | cat /etc/os-release |
| Kernel version only | uname -r |
| All kernel details | uname -a |
| Kernel from proc filesystem | cat /proc/version |
| Very old systems | cat /etc/*release |
FAQs
What is the fastest command to check the Linux version?
On Systemd-based systems, hostnamectl returns both the OS name and kernel version in one output. On any distribution, cat /etc/os-release is the most portable single command and requires no additional tools.
How do I check the Linux kernel version only?
Run uname -r in the terminal. It outputs only the kernel release number, such as 5.15.0-91-generic. For the full kernel line including architecture and build date, use uname -a instead.
How do I check the Linux version without lsb_release?
Use cat /etc/os-release, which works on virtually all modern distributions without any tool installed. On very old systems where that file is absent, try cat /etc/*release or cat /proc/version as fallbacks.
Can I check the Linux OS version remotely over SSH?
Yes. SSH into the remote machine and run any of the standard commands — uname -r, cat /etc/os-release, or hostnamectl. Ensure you have authentication credentials and sufficient access permissions before connecting.
What is the difference between the Linux distribution version and kernel version?
The distribution version identifies the named OS release, such as Ubuntu 22.04 or Fedora 39. The kernel version is a separate number identifying the core software layer managing hardware. Both change independently on their own release schedules.