How to tell if the system is a 32-bit or 64-bit Linux system
A day, need to download an installation package, suddenly forget their system is 32-bit or 64-bit system, the moment can not think how to view when 32 or 64, hehe, under the Baidu, there are many ways to find here, record, convenient for future inquiries:
The first type:
1 2 3 4 5 |
[Root@CentOS62 ~]# uname-m i686
[Root@436704 ~]# uname-m x86_64 |
The second type:
1 2 3 4 5 |
[Root@CentOS62~]# File/sbin/init /sbin/init:elf32-bit LSB SharedObject, Intel80386, version1(SYSV), dynamically linked (uses shared Libs) , for gnu/linux 2.6.18, stripped Span class= "br0" >[root@436704 ~]< Span class= "co1" ># file/sbin/init /sbin/init:elf 64-bit LSB shared object, x86-64, version 1 (Sysv, dynamically Linked (uses gkfx libs) , for gnu/linux 2.6.18, stripped |
The third type:
1 2 3 4 5 |
[Root@CentOS62~]# File/bin/cat /bin/cat:elf32-bit LSB Executable, Intel80386, version1(SYSV , dynamically linked (uses shared Libs , for gnu/linux 2.6.18 stripped [root@436704 ~]# file/bin/cat /bin/cat:elf 64-bit LSB executable, x86-64, version < Span class= "nu0" >1 (Sysv, dynamically linked (uses gkfx libs) , for Gnu/linux 2.6.18, stripped |
The fourth method:
1 2 3 4 5 6 7 |
[Root@436704 ~]# echo $HOSTTYPE x86_64
[Root@CentOS62 ~]# echo $HOSTTYPE I386
; |
Hey, the above methods are very simple, it is a look to know
In fact, there is one of the simplest way, is to see if there is no lib64 this folder, the general 64-bit system must have lib64 this folder, hehe, finally there is a method, it does not look very intuitive, but also introduced:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[root@436704 ~ # getconf long_bit 64 [root@436704 ~]# getconf word_bit 32 above is 64-bit system ---------------------------------------- [root @CentOS62 ~# getconf long_bit 32 [root@ Centos62 ~]# getconf word_bit 32 above is the 32-bit system, this does not look very intuitive, hehe ... |