How Linux uses the shell to identify system bits

  
                

Most users now use Windows systems. They all know that Windows systems are divided into 32-bit and 64-bit. In fact, Linux systems also have 32-bit and 64-bit points. Do you know how many Linux systems are you? The following small series teaches you how to use the shell to see if Linux is 32-bit or 64-bit.

Manual to view the system-digit

View digit linux system, you can do each of the following two commands

getconf WORD_BIT

to get The number of bits in word

getconf LONG_BIT

The number of bits used to get long

For 64-bit systems, the two commands should get 32 ​​and 64 respectively.

There are many ways to determine whether the Linux system is 32-bit or 64-bit. It is recommended to use getconf. However, some people think that getconf WORD_BIT=32 is 32bit, getconf WORD_BIT=64 is 64bit, please go to 64bit machine to execute, huh, huh . Getconf WORD_BIT shows the result is still 32, why?

In the 32-bit system, the int type and the long type are generally 4 bytes. In the 64-bit system, the int type is still 4 bytes, but the long has become an 8-byte inux system. Br>

Use ”getconf WORD_BIT” and ”getconf LONG_BIT” to get the number of digits in word and long

shell to determine the number of system bits

ldconfig

if [ $(getconf WORD_BIT) = ‘32’ ] && [ $(getconf LONG_BIT) = ‘64’ ] ; then

ln -s /usr/local/mysql/lib/mysql /usr /lib64/mysql

else

ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql

fi

Some other methods

uname -a

32 bits: 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

Above is Linux using the shell to view Lin The ux32-bit and 64-bit methods are described. In addition to using the shell view, you can manually execute commands to view the number of system bits.

Copyright © Windows knowledge All Rights Reserved