Search notes:

Shell command: lsb_release

lsb_release is a Python script and can be used to determine the version of a Linux distribution: lsb_release -a | grep release.
lsb stands for Linux Standard Base.

Command line options

-v --version LSB modules this system supports
-i --id Distributor ID
-d --description description
-r --release release number
-c --codename code name
-s --short short format
-a --all all of the above information
-h --help

Identify a distribution

A Linux distribution is generally identifiable with
$ lsb_release -d
Description:    Debian GNU/Linux 11 (bullseye)
Specific numbered relases are identified by
$ lsb_release -r
Release:        11

codename

$ lsb_release -cs
bullseye

Installing lsb_release

At least in Debian, lsb_release does not seem to be installed by default. It can be installed with apt:
$ sudo apt install -y lsb-release

See also

lsb_release depends on the Python package lsb_release.py which reads the CSV files under /usr/share/distro-info.
Shell commands

Index