How to check OS version using Linux command line


Most folks recall to mind Linux as an operating machine however it’s actually a kernel; A kernel is a bridge between the software and {hardware} of a pc. Linux-based working methods are in truth known as Linux distributions which generally come with the Linux kernel in conjunction with instrument package deal managers, instrument, and graphical person interface.

It is necessary to all the time know the kernel and OS model of your machine, particularly if you happen to’re an administrator. Knowing the model of your kernel and OS will let you resolve which package deal supervisor to make use of to put in new instrument and whether or not that instrument is supported via your machine or now not. It too can assist in putting in safety patches and figuring out the options to be had on your machine.

The OS model of a Linux distribution will also be made up our minds via the usage of the command-line interface in addition to a graphical person interface. In Linux, CLI is most popular over GUI because it supplies extra keep an eye on over the OS. In this newsletter, we can most commonly center of attention at the command line strategies which can be utilized to test the OS model of a Linux distribution.

There are quite a few other strategies which can be utilized to resolve the model of a Linux-based OS the usage of the command-line interface.

How to Check Linux OS model the usage of lsb_release

The lsb_release is a pre-installed application in primary Linux distributions which can be utilized to show the Linux Standard Base knowledge at the command-line interface. Use the below-given command to resolve the OS model of your machine:

lsb_release -a 

If it’s not pre-installed on your OS, you’ll use your package deal supervisor to put in this application:

sudo apt set up lsb-release 

The apt is the package deal supervisor in Debian-based methods.

If you simplest need the model quantity as an alternative of the entire LSB knowledge then use the next command:

lsb_release -d 

check os version with lsb_release

Check Linux model from the /and so forth/factor record

The /and so forth/factor is a straightforward textual content record that has the identity knowledge of the machine. This knowledge is imprinted on the display sooner than the login suggested. Use the below-given command to show the contents of the record at the command line interface:

cat /and so forth/factor 

Check Linux Version /etc/issue

Check Linux OS model from the /and so forth/os-release record

The /and so forth/os-release record incorporates the entire knowledge associated with the working machine. It is a configuration record simplest incorporated within the systemd package deal of the newest Linux distributions.

To display the contents of the /and so forth/os-release record at the CLI use the below-given command.

cat /and so forth/os-release 

Check OS Version in Linux

Check Linux Version with hostnamectl command

The major goal of the hostnamectl command is to switch or test the host identify; however this command may also be used to test the OS and Kernel model of the machine:


Find Linux OS Version with hostnamectl

How to Check OS Version on an Old Linux Systems

If you’re operating an excessively previous Linux distribution then you could now not have the ability to use any of the above instructions. Use the next command to understand the OS model for your previous machine:

cat /and so forth/*launch 

How to test Linux kernel model of the machine via the usage of the uname command
The uname command can be utilized to show the kernel model of your machine at the terminal:

uname -srm 


Linux 5.4.0-73-generic x86_64


Knowing the OS and kernel model of your machine is necessary because it helps to keep you knowledgeable in regards to the up to date options of your machine. The OS model may also be checked the usage of GUI in case your Linux distribution has a desktop setting.

In this how-to information, we realized to test the model of a Linux distribution the usage of a command-line interface. We additionally realized to test the Kernel model of the machine.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More