在哪里可以找到 Linux 中所有可等待的 "lsb_release -si" 输出的列表?



我想使用python在linux中检测一个人的发行版,我想根据发行版做不同的事情,我不知道在哪里可以找到这样的列表,我在谷歌上搜索了它,但什么都没有找到,我也运行了man lsb_release,但我在那里什么都没有得到,也许有人知道我在哪里可以发现这样的列表?

lsb_release是一个shell脚本:

$ file $(command -v  lsb_release  )
/usr/bin/lsb_release: a /usr/bin/sh script, ASCII text executable

这样你就可以在编辑器中打开它,看看它有什么作用。

我想根据发行版做不同的事情,但我不知道我在哪里可以找到这样的列表

我认为这样的列表不存在,lsb_release只是读/etc/lsb-release或本地/etc/[distro]-release文件在评论中:

# Description:
# Collect informations from sourceable /etc/lsb-release file (present on
# LSB-compliant systems) : LSB_VERSION, DISTRIB_ID, DISTRIB_RELEASE,
# DISTRIB_CODENAME, DISTRIB_DESCRIPTION (all optional).
# Then (if needed) find and parse the /etc/[distro]-release file.

例如,在我的Slackware系统上,它读取/etc/lsb-release和Fedora它读取/etc/redhat-release,所以无论你输入什么信息将会有报道。

最新更新