How to check whether the system is 32-bit or 64-bit in CentOS
1. View from the system
1.1 uname-a command
[Root @ qs-dmm-rh2 ~] # Uname-
Linux qs-dmm-rh2 2.6.18-194. el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux
[Root @ qs-xezf-db2 ~] # Uname-
Linux qs-xezf-db2 2.6.18-194. el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
1.2 file/bin/ls command
[Root @ qs-dmm-rh2 ~] # File/bin/ls
/Bin/ls: 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
[Root @ qs-xezf-db2 ~] # File/bin/ls
/Bin/ls: 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
1.3 getconf LONG_BIT command
[Root @ qs-dmm-rh2 ~] # Getconf LONG_BIT
32
[Root @ qs-xezf-db2 ~] # Getconf LONG_BIT
64
1.4 arch command
[Root @ qs-dmm-rh2 ~] # Arch
I686
[Root @ qs-xezf-db2 ~] # Arch
X86_64
2. View from CPU
[Root @ qs-dmm-rh2 ~] # Cat/proc/cpuinfo | grep flags | grep 'lm '| wc-l
0
[Root @ qs-xezf-db2 ~] # Cat/proc/cpuinfo | grep flags | grep 'lm '| wc-l
8
If the result is greater than 0, 64bit computing is supported. lm indicates long mode, and lm indicates 64bit.