Identifying your Linux OS starts with `cat /etc/os-release` or `lsb_release -d` for distribution details. Knowing how to check Linux OS is essential for troubleshooting, installing software, or configuring system settings. This guide walks you through every reliable method, from simple commands to graphical tools, ensuring you always know exactly what system you are running.
Whether you are a beginner or a seasoned sysadmin, checking your Linux distribution and version is a fundamental skill. The commands are fast, lightweight, and work on almost every major distro. Let us start with the most universal approach.
How To Check Linux Os
The most straightforward way to identify your Linux operating system is through the terminal. You do not need root access for most of these commands. They read system files that contain the distribution name, version, and sometimes the codename.
Using The Os-Release File
Every modern Linux distribution includes a file at `/etc/os-release`. This file is standardized and contains key information in a simple key-value format.
- Open your terminal application.
- Type the following command and press Enter:
cat /etc/os-release - You will see output similar to:
NAME="Ubuntu" VERSION="22.04.3 LTS (Jammy Jellyfish)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 22.04.3 LTS" VERSION_ID="22.04"
- Look for the
PRETTY_NAMEorNAMEandVERSION_IDfields.
This method works on Ubuntu, Debian, Fedora, CentOS, Arch Linux, and many others. It is the first command you should try when learning how to check Linux OS.
Using The Lsb-Release Command
The `lsb_release` command is part of the Linux Standard Base (LSB) package. It provides distribution-specific information in a clean format.
- Run:
lsb_release -ato see all details. - Run:
lsb_release -dfor just the description line. - If you get a “command not found” error, install the package:
sudo apt install lsb-release(Debian/Ubuntu) orsudo yum install redhat-lsb-core(RHEL/CentOS).
Example output for `lsb_release -d` on Ubuntu 22.04:
Description: Ubuntu 22.04.3 LTS
Checking The Hostname And Kernel Version
Sometimes you need more than just the distribution name. The kernel version tells you about the core system and its updates.
- Kernel version:
uname -r(e.g., 5.15.0-91-generic) - Full system info:
uname -a(includes hostname, kernel, architecture) - Hostname:
hostnamectl(also shows OS details on systemd systems)
The `hostnamectl` command is particularly useful because it combines hostname, OS, kernel, and architecture in one view. On a Fedora system, it might show: Operating System: Fedora Linux 39 (Workstation Edition).
Reading The Issue Or Release Files
Older distributions and some minimal systems rely on files like `/etc/issue` or `/etc/*release`. These files are simple text files containing the distribution name.
cat /etc/issue– Shows a short banner, often including the OS name.cat /etc/redhat-release– For Red Hat-based systems (RHEL, CentOS, Fedora).cat /etc/debian_version– For Debian-based systems.cat /etc/SuSE-release– For openSUSE or SUSE Linux.
These files are not as standardized as `/etc/os-release`, but they are still present on many distributions. They are a fallback if the primary commands do not work.
Graphical Methods For Desktop Users
If you are using a Linux desktop environment, you can often find the OS information without opening the terminal. This is especially helpful for beginners learning how to check Linux OS visually.
Using System Settings
Most desktop environments include a “Settings” or “About” section that displays the OS version.
- GNOME: Go to Settings → About. You will see the OS name, version, and hardware details.
- KDE Plasma: Open System Settings → About This System.
- XFCE: Go to Settings Manager → About Xfce (may not show OS version directly).
- Cinnamon: Menu → System Settings → System Info.
These graphical tools read the same system files as the terminal commands, so the information is identical. They are just presented in a more user-friendly way.
Using The Neofetch Tool
Neofetch is a popular command-line tool that displays system information in a visually appealing way, including an ASCII logo of your distribution. It is not installed by default but is widely available.
- Install Neofetch:
sudo apt install neofetch(Ubuntu/Debian),sudo dnf install neofetch(Fedora),sudo pacman -S neofetch(Arch). - Run:
neofetch - You will see a colorful output with OS, kernel, uptime, packages, and more.
Neofetch is great for sharing your system info in forums or troubleshooting threads. It gives a complete picture in one glance.
Checking Specific Distributions
Different Linux families have their own quirks. Here is how to check Linux OS on the most common distros.
Ubuntu And Debian
Ubuntu and Debian are closely related. Use these commands:
lsb_release -a(works on both)cat /etc/os-releasecat /etc/debian_version(shows Debian version even on Ubuntu)hostnamectl
On Ubuntu, you can also check the version from the update manager: sudo do-release-upgrade --check-dist.
Fedora And Red Hat Enterprise Linux
RHEL-based systems use the Red Hat-specific files.
cat /etc/redhat-releasecat /etc/os-releaserpm -q centos-release(for CentOS)rpm -q fedora-release(for Fedora)
Fedora also shows the version in the GNOME About panel if you are using the default desktop.
Arch Linux And Manjaro
Arch Linux is a rolling release, so version numbers are less meaningful. However, you can still identify it.
cat /etc/os-release(shows ID=arch)pacman -Q systemd(shows systemd version as a proxy for recency)- For Manjaro:
cat /etc/lsb-releaseorcat /etc/manjaro-release
Manjaro also includes a graphical “Manjaro Settings Manager” that displays the kernel and OS info.
OpenSUSE
openSUSE has its own release file.
cat /etc/os-releasecat /etc/SuSE-release(older versions)zypper --version(shows package manager version)
The YaST control center also provides system information under “System Information”.
Why You Need To Know Your Linux Version
Understanding how to check Linux OS is not just trivia. It has practical implications for system management.
- Software compatibility: Many applications require a specific kernel or distribution version.
- Security updates: You need to know your version to apply the correct patches.
- Troubleshooting: When asking for help online, people need your OS details to give accurate advice.
- Package management: Different distros use different package managers (apt, dnf, pacman).
For example, installing Docker requires knowing whether you are on Ubuntu 20.04 or 22.04, as the repository URLs differ.
Common Errors And How To Fix Them
Sometimes the commands do not work as expected. Here are typical issues and solutions.
Command Not Found
If `lsb_release` is missing, install it. On Debian/Ubuntu: sudo apt install lsb-release. On Fedora: sudo dnf install redhat-lsb-core.
If `cat /etc/os-release` returns nothing, the file might not exist. Try `cat /etc/*release` to see all release files.
Permission Denied
Most of these files are world-readable. If you get a permission error, you might be in a restricted environment (like a container). Use `sudo cat /etc/os-release` if needed.
Empty Or Minimal Output
Some minimal Docker containers or embedded systems have stripped-down OS files. In that case, try `uname -a` to get kernel info, or check `/proc/version`.
Using Scripts To Automate OS Detection
If you manage multiple servers, you can write a simple script to check Linux OS across machines. Here is a basic Bash example:
#!/bin/bash
if [ -f /etc/os-release ]; then
. /etc/os-release
echo "OS: $NAME $VERSION"
elif [ -f /etc/redhat-release ]; then
cat /etc/redhat-release
else
echo "Unknown OS"
fi
This script reads the os-release file first, then falls back to redhat-release. You can expand it to check other files as needed.
For remote systems, use SSH: ssh user@server "cat /etc/os-release".
Frequently Asked Questions
What Is The Easiest Way To Check My Linux OS Version?
The easiest method is running cat /etc/os-release in the terminal. It works on almost all modern distributions and shows the name and version clearly.
How Do I Check Linux OS Without Using The Terminal?
On desktop versions, go to System Settings → About (GNOME) or System Settings → About This System (KDE). The exact path varies by desktop environment.
Why Does `Lsb_release -A` Show “No LSB Modules Are Available”?
This is normal on some distributions. The LSB modules are optional. The command still shows the Distributor ID and Description, which is what you need.
Can I Check The Linux Kernel Version Separately?
Yes, use uname -r for just the kernel release, or uname -a for full system info including kernel, hostname, and architecture.
How Do I Check The OS On A Remote Server?
SSH into the server and run the same commands: ssh user@server "cat /etc/os-release" or ssh user@server "lsb_release -d".
Final Thoughts On Identifying Your Linux System
Now you have multiple reliable methods for how to check Linux OS. Start with the terminal commands like `cat /etc/os-release` or `lsb_release -d` for quick results. For desktop users, the graphical settings are equally effective. Remember that knowing your exact distribution and version is crucial for software installation, security updates, and getting accurate help online.
Practice these commands a few times until they become second nature. Whether you are managing a single laptop or a fleet of servers, this skill will save you time and prevent mistakes. The next time someone asks “what Linux are you running?”, you will have the answer in seconds.