Linux lsb_release command
The lsb_release command displays LSB (Linux Standard Base) information about your specific Linux distribution, including version number, release codename, and distributor ID.
As with other 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 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 displays
Distributor ID: Debian
|-d, --description||Display a description of your Linux distribution. For instance, if you are running CentOS 7, this displays 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 displays
|-a, --all||Display all of the above information. For instance, if you are running Arch Linux, this displays
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 resembles the following:
LSB Version: core-5.0-amd64:core-5.0-noarch
Distributor ID: openSUSE project
Description: openSUSE Leap 42.2
If you receive a message like this:
No LSB modules are available
...you 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.