1. 程式人生 > >檢視linux是32位還是64位

檢視linux是32位還是64位

方法一:

        file /sbin/init 或 file /bin/ls

        結果如下

[[email protected] ~]# 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.18, stripped

[[email protected] ~]# file /bin/ls

/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

如果顯示為32bit為32位,64bit則為64位。

方法二:

[[email protected] ~]# uname -a

Linux localhost.lw 2.6.32-358.el6.i686 #1 SMP Thu Feb 21 21:50:49 UTC 2013 i686 i686 i386 GNU/Linux

顯示x86_64表示為64位,i686則為32位。

方法三:

[[email protected] ~]# getconf LONG_BIT

32

直接看顯示結果