How to check the OS version in Linux? Simple and Easy methods

In our day to day life, sometimes it is required that we need to check the version of Operating System we are using. For example, If we need to install a software, we need to check whether our current OS supports that particular version or not.

In Windows It is easy to check, as it is entirely GUI based OS. However, in Operating Systems like Linux/Unix, where we prefer to use Command line instead of the GUI, it is difficult to remember all the commands.

In this post we are going to see How to check the Operating System details we are using in Linux, in 3 Simple methods. There are several ways we can check, but, below are the easy way to check the Linux OS version and OS details easily.

Linux Command to Check the OS Version and details

Using os-release file available in Linux’s etc directory

You can run below command to view the file, which contains Linux Operating System (OS) info

~$ cat /etc/os-release 

output of above

VERSION="18.04.4 LTS (Bionic Beaver)"
PRETTY_NAME="Ubuntu 18.04.4 LTS"
Using lsb_release command

We can get the Linux OS info using lsb_release command. LSB Stands for Linux Standard Base

$ lsb_release -a

Output of lsb_release command is

~$ lsb_release -a

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.4 LTS
Release:        18.04
Codename:       bionic
Using version file available in Linux’s proc directory

Same like os-release, we can use below command to view the version file

~$ cat /proc/version

output of above cat command is

~$ cat /proc/version
Linux version 4.15.0-1037-gcp (buildd@lgw01-amd64-031) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #39-Ubuntu SMP Wed Jul 3 06:28:59 UTC 2019

Above are my preferred methods to get the Linux OS details in simple and easy way.

What is your best command to get the OS details? mention them in comments below.