How to use the shell command to get the version of Linux Distributions All In One
如何使用 shell 命令获取 Linux 发行版的版本
- hostnamectl
- cat /etc/os-release
- lsb_release -a
Linux Distributions
- Debian
- Ubuntu
- Raspberry Pi OS
https://en.wikipedia.org/wiki/Linux_distribution
solutions ✅
hostnamectl
$ hostnamectl
Static hostname: raspberrypi
Icon name: computer
Machine ID: a983fcbfe97e4a6d89ab5ec87d937b83
Boot ID: b1dbb5a0f2014ce087624c262c67aec3
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 6.1.21-v8+
Architecture: arm64
cat /etc/os-release
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
lsb_release -a
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye