The quickest ways to find your Linux version
The command you use depends on what information you need. If you want the kernel version — the core of the operating system — run uname -r in your terminal. If you want the distribution name and version — like Ubuntu 22.04 or Fedora 38 — use cat /etc/os-release instead. Most people need the distribution version, so start there.
Both commands work on any Linux system. They run instantly and require no special permissions. You do not need to be root or use sudo, though some older systems may behave differently.
Key Takeaways
- Use cat /etc/os-release to see your distribution name and version number in a format designed for humans to read.
- Use uname -r to see only the kernel version, which is different from your distribution version.
- Use hostnamectl on systemd systems (most modern distributions) to see both kernel and operating system version in one command.
- The /etc/lsb-release file works on Debian and Ubuntu systems and shows version information in a simpler format than os-release.
Using cat /etc/os-release for distribution details
Open a terminal and type cat /etc/os-release, then press Enter. The output shows the distribution name, version number, version ID, and sometimes a pretty name. On Ubuntu 22.04, you will see lines like NAME="Ubuntu", VERSION="22.04 LTS", and VERSION_ID="22.04".
This file exists on all modern Linux distributions. It is the standard way distributions announce their version to programs that need to know. The format is always key=value pairs, one per line, so it is easy to read and easy for scripts to parse.
If the file does not exist on your system, you have a very old distribution. Try cat /etc/issue instead, which is older but still widely supported.
Using uname to check the kernel version
Type uname -r to see only the kernel version. The output looks like 5.15.0-86-generic on Ubuntu or 6.5.9-200.fc38.x86_64 on Fedora. This is the version of the Linux kernel itself, not the distribution that packages it.
The kernel version matters when you are installing drivers, compiling software, or troubleshooting hardware problems. The distribution version matters when you are installing packages or checking support status. They are different things, and you may need both.
For more detail, use uname -a to see the kernel version, hardware architecture, and processor type all at once. This is useful when you are reporting a problem or checking whether your system is 32-bit or 64-bit.
Using hostnamectl on modern systems
If your system uses systemd — which includes Ubuntu 16.04 and later, Fedora 15 and later, and most other modern distributions — type hostnamectl with no arguments. The output shows your hostname, operating system name, operating system version, kernel version, and hardware architecture in one readable list.
This command is convenient because it combines the information from multiple sources into one place. It is designed for humans to read, not for scripts to parse, so it is best for quick checks at the terminal.
If the command does not exist or returns an error, your system does not use systemd. Use cat /etc/os-release and uname -r separately instead.
Checking version on Debian and Ubuntu systems
Debian and Ubuntu systems have a file called /etc/lsb-release that shows version information in a simpler format than os-release. Type cat /etc/lsb-release to see lines like DISTRIB_ID=Ubuntu, DISTRIB_RELEASE=22.04, and DISTRIB_CODENAME=jammy.
The codename — like jammy, focal, or bullseye — is useful when you are searching for packages or documentation specific to your version. It is also easier to remember than a version number.
This file does not exist on non-Debian systems, so it is not a universal method. But if you know you are on Ubuntu or Debian, it is often the quickest way to check.
Understanding the difference between kernel and distribution versions
The kernel is the core program that manages hardware and runs processes. The distribution is a collection of the kernel, package manager, system utilities, and pre-installed software. You can have the same kernel version on two different distributions, or different kernel versions on the same distribution.
When someone asks "what version of Linux are you running," they usually mean the distribution version. When a driver or compiler asks for the kernel version, they mean the kernel. Knowing which one you need prevents confusion when you are searching for help or installing software.
A distribution can also update the kernel without changing the distribution version number. Ubuntu 22.04 shipped with kernel 5.15, but later updates to 22.04 may include kernel 5.19 or 6.2. The distribution version stays 22.04, but the kernel version changes.
Checking version in a graphical desktop environment
If you prefer not to use the terminal, most Linux desktops have a settings or system information window. On GNOME (used by Ubuntu, Fedora, and others), click the system menu in the top right, select Settings, then go to About. The window shows the operating system name, version, and kernel version.
On KDE Plasma (used by Kubuntu, Fedora KDE, and others), open System Settings, then go to About This System. The information is laid out similarly.
The graphical method is slower than typing a command, but it is useful if you are not comfortable with the terminal or need to show the information to someone else on screen.
Frequently Asked Questions
What is the difference between kernel version and distribution version?
The kernel is the core program that manages hardware. The distribution is the kernel plus package manager, utilities, and pre-installed software. You need the kernel version when installing drivers or compiling code. You need the distribution version when installing packages or checking support status.
Why does uname -r show a different version than /etc/os-release?
They are showing different things. The uname command shows the kernel version. The os-release file shows the distribution version. A distribution can ship with one kernel version and update to a newer kernel later without changing the distribution version number.
Can I check the version without opening a terminal?
Yes. On GNOME desktops, open Settings and go to About. On KDE Plasma, open System Settings and go to About This System. Both show the operating system and kernel version in a graphical window. The terminal method is faster, but the graphical method works if you prefer not to use the command line.
What if /etc/os-release does not exist on my system?
Your system is older than most distributions in current use. Try cat /etc/issue instead, which is an older standard. You can also use uname -a to see the kernel version, though it will not tell you the distribution name or version.
Does the version number tell me if my system is up to date?
The version number tells you which release you are running, not whether you have the latest security updates. A system running Ubuntu 22.04 from six months ago has the same version number as one updated today, but different patches. Check your package manager for available updates to see if your system needs security fixes.