Linux lsb_release command
The lsb_release command displays LSB (Linux Standard Base) information about your specific Linux distribution. It's a reliable way to get version information about the Linux system you're using.
Like all GNU software, lsb_release uses a single dash (-) for short options, and two dashes (--) for long options.
|-v, --version||Show the version of the Linux Standard Base that your system is compliant with. The version is displayed as a colon-separated list of LSB module descriptions.|
|-i, --id||Display the ID of your Linux distributor. For instance, if you are running Debian, this option will display
Distributor ID: Debian
|-d, --description||Display a description of your Linux distribution. For instance, if you are running CentOS 7, this will display something like
Description: CentOS Linux release 7.3.1611 (Core)
|-r, --release||Display the release number of the current operating system. For instance, if you are running Fedora 25, this will output
|-c, --codename||Display the codename of the current operating system. For instance, if you are running Ubuntu 16.04, this will display
|-a, --all||Display all of the above information. For instance, if you are running Arch Linux, this will display
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
|-s, --short||Use the "short" output format, which omits headers. You can use this in combination with another option. For instance, if you are running Fedora 25, the command
|-h, --help||Display a help message which summarizes these options.|
Installing LSB Core
lsb_release is part of a software package called the LSB core, which is not necessarily installed on your system by default.
To install it, run the command below that corresponds to your specific system:
sudo apt-get update && sudo apt-get install lsb-core
sudo yum update && sudo yum install redhat-lsb-core
sudo dnf update && sudo dnf install redhat-lsb-core
sudo zypper update && sudo zypper install lsb-core
pacman -Syu lsb-release
If your Linux distribution is not listed here, consult your package manager's repository for the package that contains "lsb-core" and/or "lsb_release".
Display all LSB information specific to your Linux distribution. Output will resemble the following:
LSB Version: core-5.0-amd64:core-5.0-noarch
Distributor ID: openSUSE project
Description: openSUSE Leap 42.2
Note: If you receive a message like this:
No LSB modules are available
...you will need to install the LSB core software first. See section Installing LSB Core above for more information.
uname — Print information about the current system and its kernel.