查看Linux发行版版本号
程序员文章站
2022-03-01 12:38:56
...
CentOS、Redhat
# 方法一
rpm -q centos-release
rpm -q redhat-release
# 方法二
cat /etc/redhat-release
cat /etc/os-release
# 方法三
lsb_release -a
SUSE
# 方法一
rpm -q sles-release
# 方法二
cat /etc/SuSE-release
cat /etc/os-release
# 方法三
lsb_release -a
Debian
# 方法一
lsb_release -a
# 方法二
cat /etc/debian_version
cat /etc/os-release
# 方法三
dpkg -l|grep base-files|awk '{print $3}'
Ubuntu
# 方法一
lsb_release -a
# 方法二
cat /etc/os-release
openEuler
# 方法一
rpm -q openEuler-release
# 方法二
cat /etc/openEuler-release
cat /etc/os-release
EulerOS
# 方法一
rpm -q euleros-release
# 方法二
cat /etc/euleros-release
cat /etc/os-release