在 Debian(以及其它 Linux 发行版)里,getconf 可以用来查系统的字长(word size / 位数),常用下面几种方式:
getconf LONG_BIT
输出:
32 → 32 位系统64 → 64 位系统int / long 等类型的字长getconf INT_BIT
getconf LONG_BIT
getconf WORD_BIT
getconf POINTER_SIZE
3264getconf -a | grep -i bit
或
getconf -a | grep -i long
getconf LONG_BIT 不是 CPU 位数,而是当前运行系统的位数LONG_BIT 仍是 32如果你是想确认 CPU 是否支持 64 位,可以用:
lscpu | grep -i "CPU op-mode"
需要我帮你区分 32/64 位环境或交叉编译场景也可以继续问。