How to check os version in Linux command line

ww‮‬w.lautturi.com
How to check os version in Linux command line

To check the version of the operating system on a Linux system using the command line, you can use the lsb_release command. This command displays information about the Linux Standard Base (LSB) compliance of the system, including the version of the operating system and the distribution.

To check the version of the operating system on a Linux system, open a terminal window and run the following command:

lsb_release -a

The lsb_release command will display a list of information about the LSB compliance of the system, including the Distributor ID, Description, and Release.

For example, the output might look something like this:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal

In this example, the operating system is Ubuntu 20.04.2 LTS, with a release number of 20.04 and a codename of focal.

It's worth noting that the lsb_release command may not be available on all Linux systems. In this case, you can use the cat /etc/*release* command to display the version of the operating system.

For example:

cat /etc/*release*

This will display the contents of the /etc/*release* files, which contain information about the version of the operating system and the distribution.

Alternatively, you can use the uname command to display information about the kernel of the system. This command displays the kernel name, version, and release, as well as the machine hardware name.

Created Time:2017-10-28 21:38:59  Author:lautturi