Now most users use the windows system. They all know that the windows system is divided into 32-bit and 64 bit. In fact, the Linux system is also divided into 32-bit and 64 bit. Do you know how many bits your Linux system is? The following small series will teach you how to use the shell to check whether Linux is 32-bit or 64 bit.
Manually view system bits
To view the number of bits in the Linux system, you can execute the following two commands respectively
Number of bits used to get word
Number of bits used to get long
For 64 bit systems, the above two commands should get 32 and 64 respectively.
There are many ways to judge whether the Linux system is 32-bit or 64 bit. Getconf is recommended. However, some people think that getconf word_ Bit = 32 is 32bit, getconf word_ Bit = 64 is 64bit. Please run it on the 64bit machine, hehe. getconf WORD_ Bit display result or 32, why?
In 32-bit systems, the int type and long type are generally 4 bytes. In 64 bit systems, the int type is still 4 bytes, but long has become an 8-byte variable in inux systems
Use “getconf” word_ Bit “and” getconf long “_ Bit “gets the digits of word and long
Shell judge system bits
if ［ $（getconf WORD_BIT） = ‘32’ ］ && ［ $（getconf LONG_BIT） = ‘64’ ］ ; then
ln -s /usr/local/mysql/lib/mysql /usr/lib64/mysql
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
Add some other methods
32 bit: Linux localhost.localdomain 2.6.32-431.17.1.el6.i686 #1 SMP Wed May 7 20:52:21 UTC 2014 i686 i686 i386 GNU / Linux
64 bit: Linux demolinux 2.6.32-431.11.2.el6.x86_ 64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_ 64 x86_ 64 x86_ 64 GNU/Linux
The above is how Linux uses the shell to view Linux 32-bit and 64 bit. In addition to using the shell, you can also manually execute commands to view the system bits.