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. -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 |
$ lsb_release -d Description: Debian GNU/Linux 11 (bullseye)
$ lsb_release -r Release: 11
$ lsb_release -cs bullseye
lsb_release does not seem to be installed by default. It can be installed with apt: $ sudo apt install -y lsb-release
lsb_release depends on the Python package lsb_release.py which reads the CSV files under /usr/share/distro-info.