1.getconf LONG_BIT
[root@localhost /]# getconf LONG_BIT
64
2.uname
x86_64表示64位系统, i686 i386表示32位系统。
[root@localhost /]# uname -a
Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost /]# uname -r
3.10.0-514.el7.x86_64
[root@localhost /]# uname -m
x86_64
3.arch
[root@localhost /]# arch
x86_64
4.file
[root@localhost /]# file /sbin/init
/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
[root@localhost /]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3d705971a4c4544545cb78fd890d27bf792af6d4, stripped
5.cat /proc/cpuinfo | grep flags | grep ’ lm ’ | wc -l
结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit。(参考网上的说法)
[root@localhost /]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
1
注意:getconf WORD_BIT命令不可用。去64bit机器上执行,getconf WORD_BIT显示结果还是32