Check the OS Version in Linux

When we want to install the Software on our system, first we must know whether our current Operating System is supporting this version of the software or not. In Windows, we can easily check it as Windows is based on a GUI-based Operating System.

But we prefer to use the Command line instead of the GUI in an Operating System like Linus/Unix. In this article, we will learn how to check the details of the Operating System we are using in Linux. We will work with one of the Linux distributions of Linux named UBUNTU. We will discuss How to check the Version of Ubuntu.

5 Simple Ways to Check the Linux OS Version:

In this article, we will work on one of the distributions of Linux, which is Ubuntu. So we will discuss different ways to Check the Version of Ubuntu.

1) Using the os-release file available in Linux’s etc directory to check the Version of Ubuntu.

We can check the Linux Operating System (OS) information by running the below command.

cat /etc/os-release 

Output:

used `cat /etc/os-release` for displaying the Version of Ubuntu

To only view the name and version of Ubuntu or Red Hat Linux, we can filter out it by using the `grep` command.

grep '^VERSION' /etc/os-release
grep -E '^(VERSION|NAME)=' /etc/os-release


only view the name and version of Red Hat Linux

In this ex, we checked our name and version of Red Hat Linux.

2) Using the `lsb_release` Command to Check the OS Version of Ubuntu.

LSB Stands for Linux Standard Base, we can check the Linux Operating System (OS) with the sing lsb_release command.

lsb_release -a

Output:

used `lsb_release -a` to display the ng OS version in linux 

3) Using the `hostnamectl` Command to Check Version of Ubuntu.

We can use the `hostnamectl` command to check the Linux Operating System (OS) or we can say to check the version of Ubuntu.

hostnamectl

Output:

used hostnamectl for displaying the OS version of Ubuntu in Linux

4) `uname` Command in Linux to Check the Version of Ubuntu.

To print the version of the Linux kernel we can use the `uname` command.

uname -r

version of Linux kernel

5) Using GUI (Graphical User Interface) to Check the Version of Linux.

We have 3 Simple Steps to find OS version of Ubuntu in Linux.

Step 1: Click on the start menu application.

As shown below.

click the application point by the yellow arrow

Step 2: Search Settings kernel on the Search bar.

Click on settings as shown below.

click the application pointed by the yellow arrow

Step 2: click on About.

As shown below. And we can easily see the version of Ubuntu.

click on About to view the details

Conclusion

It is essential to know the operating system version when we are installing software or performing any kind of system update. Checking the OS version in Windows is straightforward due to the GUI (Graphical User Interface), whereas in Linux users have several ways to check the OS version including OS-release file, lsb_release command, hostnamectl command, or the GUI (Graphical User Interface). One must understand the importance of knowing the CLI methods to find out the OS version as Linux is mostly used for CLI, by this users can troubleshoot issues, install new software, and keep the system updated.

Check the OS Version in Linux – FAQs

How to check OS Version on Linux using command line?

You can use various commands like “cat /etc/os-release”, “lsb_release -a”, “hostnamectl”, or “uname -r” to check the OS version on Linux via the command line.

How to Check Current OS Version in Linux?

To check the current OS version in Linux, open the command line and use one of the commands like “cat /etc/os-release”, “lsb_release -a”, “hostnamectl”, or “uname -r”.

How to check Linux version in Putty?

In PuTTY, you can use commands like “cat /etc/os-release”, “lsb_release -a”, “hostnamectl”, or “uname -r” to check the Linux version via the command line.

What is the latest Linux OS version?

The latest Linux OS version may vary depending on the distribution. You can check the official website of the Linux distribution you’re interested in for the latest version information.

how to Check OS version in Linux Red Hat?

To check the OS version in Linux Red Hat, you can use commands like “cat /etc/redhat-release”, “lsb_release -a”, “hostnamectl”, or “uname -r” in the command line.


Contact Us