一般都是用 uname -a, uname -m (顯示 i386 => 32bits, x86_64 => 64bits)
系統如何判斷 32bits / 64bits
在嘿嘿星期四的討論學到, Mat: 用 `file /bin/bash`, 結果非常淺顯易懂.
- 64bits: file /bin/bash
/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
- 32bits: file /bin/bash
/bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
感謝 sshsiung 提供的方法:
- getconf LONG_BIT # 32bits
32
- getconf LONG_BIT # 64bits
64