我在哪里可以找到 linux 中 "lsb_release -si" 的所有可用输出的列表?
where can i find the list of all awailable outputs of "lsb_release -si" in linux?
我想使用 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
因此您可以在编辑器中打开它并查看它的作用。
I want to do different things depending on a distro and I don't know
where I could find such list
我认为不存在这样的列表,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
所以无论你输入什么信息
会有报道。
我想使用 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
因此您可以在编辑器中打开它并查看它的作用。
I want to do different things depending on a distro and I don't know where I could find such list
我认为不存在这样的列表,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
所以无论你输入什么信息
会有报道。