判斷Linux/Unix爲32位或64位ide
方法一:ui
$uname -mspa
x86_64 (64位)ip
i686 (32位)get
方法二:it
$getconf LONG_BITio
32 (32位)table
64 (64位)class
方法三:object
$ file /sbin/init
/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x5f722891935c0f35fd8f318d4606b334a9b1d423, stripped
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
/sbin/init: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped