Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

How to Check the OS Version in Linux?

  • Difficulty Level : Medium
  • Last Updated : 15 Apr, 2021

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

But we prefer to use the Command line instead of the GUI in 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 use three simple methods to check the Linux OS version:

  1. Using os-release file available in Linux’s etc directory
  2. Using lsb_release command
  3. Using version file available in Linux’s proc directory

Example 1: Using os-release file available in Linux’s etc directory.

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

~$ cat /etc/os-release 

Output:



How to check the  OS version in Linux ?

Example 2: Using lsb_release command.

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

$ lsb_release -a

Output:

How to check the  OS version in Linux ?

Example 3: Using version file available in Linux’s proc directory.

We can use the below command to check the Linux Operating System (OS)

~$ cat /proc/version

Output:

How to check the  OS version in Linux ?

My Personal Notes arrow_drop_up