在 Debian 里 getconf 本身并不能直接查“Debian 版本号”,它主要用来查询 系统配置变量,比如:
如果你看到有人用它来“判断系统”,通常是 间接信息。
getconf 能查到什么(Debian 上)getconf LONG_BIT
输出示例:
64
说明是 64 位系统。
getconf -a | grep POSIX
或:
getconf _POSIX_VERSION
⚠️ 注意:
这和 Debian 版本号无关,只能说明系统符合哪个 POSIX 规范。
getconf -a
例如:
getconf PAGE_SIZE
getconf PATH_MAX /
cat /etc/debian_version
示例输出:
11.6
或
bookworm/sid
lsb_release -a
输出示例:
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
如果没装:
sudo apt install lsb-release
cat /etc/os-release
getconf 查不到 Debian 版本?因为:
getconf 来自 glibc
getconf不能查 Debian 版本号,只能查系统位数或 POSIX 配置。
查 Debian 版本请用:
cat /etc/debian_version
# 或
lsb_release -a
如果你是想 用 getconf 判断是不是 Debian,我也可以帮你写一个识别脚本。