Understanding Linux OS Version
To check your OS version in Linux, run cat /etc/os-release in the terminal. It works on almost every modern distribution, including Ubuntu, Debian, Fedora, RHEL, Rocky Linux, AlmaLinux and SUSE, and it shows the distribution name, version and ID in one output. This guide covers that command plus five more methods for checking the OS and kernel version in 2026.
The Linux OS version provides detailed information about the distribution name, release version, and system architecture, while the kernel version indicates the core component of the operating system that manages hardware resources, processes, and system security. Knowing both is important for efficient system management, whether you are patching a server, installing software that targets a specific release, or confirming that a system is still on a supported version.
Methods to Check OS Version in Linux (With Examples)
Method 1 : Using /etc/os-release
The /etc/os-release file contains standardized operating system identification data, and it is the most reliable and widely supported method for checking the Linux OS version across almost all modern Linux distributions. On systemd-based distributions, the file is defined by the systemd project and is the standard source that most other tools read from.
- This command displays important details such as the operating system name, version ID, and distribution information.
cat /etc/os-release
Method 2: Using lsb_release
The lsb_release command provides Linux Standard Base information, which includes the distributor ID, release number, and codename, making it especially useful on Ubuntu-based systems. On some minimal installations and containers the command may not be installed, in which case you can fall back to /etc/os-release.
lsb_release -a
Method 3: Using uname -a
The uname -a command provides a complete overview of the system information, including the kernel name, kernel version, hostname, architecture, and operating system type, making it one of the most comprehensive commands for quickly assessing the system environment from the command line. Note that it describes the kernel rather than the distribution, so it will not tell you whether you are running Ubuntu, Debian or Rocky Linux.
uname -a
Method 4: Using hostnamectl
The hostnamectl command is available on systemd-based systems and provides a comprehensive overview of the operating system, kernel version, system architecture, and hostname in a single output. It is a convenient choice when you want the distribution and kernel details together without running two separate commands.
hostnamectl
Method 5: Using /proc/version
The /proc/version file provides low-level system information about the Linux kernel, including the exact kernel version, the compiler used to build the kernel, and the build date, making it especially useful for advanced troubleshooting, kernel verification, and system diagnostics. Like uname, it reports on the kernel only, not the distribution.
cat /proc/version
Method 6: Checking Kernel Version
The kernel version represents the core of the Linux operating system, and checking it is useful when diagnosing performance issues, driver compatibility problems, or kernel-specific errors. Use the command below when you only need the kernel release number, for example to compare it against a vendor's compatibility list.
uname -r
Conclusion
Checking the Linux OS and kernel version is an important task for system administration, troubleshooting, and software compatibility verification.
Linux provides multiple command-line methods to view operating system and kernel details, allowing users to choose the most suitable command based on their requirements.
The /etc/os-release file is the most reliable and recommended method for identifying the Linux distribution and version across modern systems.
Commands such as uname -r and uname -a are useful for quickly checking kernel version and system architecture details.
Advanced commands like cat /proc/version provide detailed kernel build and compiler information for deeper diagnostics.
In some systems, the /etc/issue file may display a security banner instead of OS details due to security and compliance policies.
Using the correct command helps ensure accurate system information, better troubleshooting, and efficient Linux system management.
Related service: Server Management Service - Managed Linux and Windows servers: monitoring, patching, security and 24/7 support.


