Linux Command - lsb_release

lsb_release v2.0 prints certain LSB (Linux Standard Base) and Distribution information.

Syntax

1
lsb_release [OPTION]

Another way to get linux version is to print /etc/os-release file.

1
cat /etc/os-release

Options

Option Description
-h show this help message and exit
-v show LSB modules this system supports
-i show distributor ID
-d show description of this distribution
-r show release number of this distribution
-c show code name of this distribution
-a show all of the above information
-s show requested information in short format

Examples

Show all lsb release info

1
lsb_release -a

Sample output

1
2
3
4
5
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

Show distributor ID

1
lsb_release -i

Sample output

1
Distributor ID:	Ubuntu

Reference