How to Check OS Version in Linux via Command Line 2026

ABHILASH CA

Junior Devops Engineer

Last Updated: 4 November 2026
How to Check OS Version in Linux via Command Line 2026
🖥️12,400+PCs Fixed
⭐4.9★Google Rating
⚡<15 minAvg. Response
🛡️ISO 27001Certified

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.

Linux OS VersionSystem Information

Get the Free Linux Server Admin Cheatsheet (PDF)

Essential commands for server management, networking, and troubleshooting — all on one printable page.

Running Linux servers? Let us manage them for you.

Our Managed Linux Server plans cover updates, security hardening, monitoring, and 24/7 incident response — so your servers stay up and your team stays focused.

  • Proactive OS patching and security updates
  • 24×7 monitoring with instant alerting
  • Backup configuration and disaster recovery
  • Dedicated Linux engineers on call
See Pricing Plans →

What our customers say

“Our production server went down at 2 AM. CloudHouse had it back online in under 20 minutes. Incredible response time.”

Arun S.

CTO, SaaS Startup

“They migrated our entire infrastructure from Ubuntu 18 to 22 with zero downtime. Couldn't have asked for better.”

Deepak N.

DevOps Lead

Frequently Asked Questions

Yes — 90% of fixes are done over a secure remote session in 15–30 minutes. Our technicians connect safely using industry-standard tools.

Need this done for you?

Server Management Service

Managed Linux and Windows servers: monitoring, patching, security and 24/7 support.

Learn more

Book your free 15-minute diagnosis

A certified technician will call you back within 15 minutes during business hours.

Share this article

Leave a Comment

Comments (0)

Loading comments...