lsb_release
Display Linux distribution information
TLDR
Print all available information
Print a description (usually the full name) of the operating system
Print only the operating system name (ID), suppressing the field name
Print the release number and codename of the distribution, suppressing the field names
SYNOPSIS
lsb_release [OPTIONS]
PARAMETERS
-i, --id
Displays the distributor ID.
-d, --description
Displays the description of the distribution.
-r, --release
Displays the release number of the distribution.
-c, --codename
Displays the codename of the distribution.
-a, --all
Displays all available information (ID, Description, Release, Codename).
-s, --short
Displays all information in a short, terse format, suitable for scripts.
-v, --version
Displays the version of the lsb_release utility itself.
-h, --help
Displays a help message and exits.
DESCRIPTION
lsb_release is a command-line utility used to display distribution-specific information, conforming to the Linux Standard Base (LSB) specification. The LSB aims to standardize the internal structure of Linux systems, allowing third-party applications to run on a wider range of Linux distributions. This command provides crucial details about the current operating system, such as the distributor ID, release version, codename, and a descriptive string. It's particularly useful for scripts that need to identify the exact Linux distribution and its version to perform conditional actions or checks. By querying the system's LSB data, lsb_release helps ensure compatibility and provides a standardized way to retrieve system identification information. It is widely used in automated environments and for troubleshooting to quickly ascertain the OS specifics without parsing various system files.
CAVEATS
The lsb_release command relies on the presence and correctness of the lsb-release package or equivalent files (e.g., /etc/lsb-release, /etc/os-release) on the system. If these files are missing, malformed, or if the distribution is not fully LSB compliant, the command may not return accurate or complete information. Its output can also be influenced by distribution-specific implementations or overrides.
OUTPUT FORMAT
The command's output varies depending on the options used. By default or with flags like --all, it typically presents information in a "Key: Value" format, making it human-readable. When the --short option is employed, the output is condensed to a single line, often delimited by tabs or newlines, which is highly suitable for scripting and automated parsing.
LSB COMPLIANCE
The lsb_release command directly reflects the information defined by the Linux Standard Base. This standard aims to ensure binary compatibility among different Linux distributions. While lsb_release provides this standardized information, it's important to note that a distribution's full adherence to LSB can vary. The data presented is sourced from files like /etc/lsb-release, which are part of the LSB specification.
HISTORY
The lsb_release command is an integral part of the Linux Standard Base (LSB) project, an initiative by the Linux Foundation. The LSB was established with the primary goal of standardizing the Linux operating system, thereby reducing fragmentation and enabling software vendors to develop applications that could run on multiple LSB-compliant distributions without significant modifications. The lsb_release utility was created to provide a convenient and standardized way for users and scripts to query this LSB-specific information directly from the command line, offering a consistent output across various Linux distributions that adhere to the LSB specifications. Its development paralleled the evolution of the LSB itself, becoming a common tool for system identification.