One line can be done, output 32 or 64.
You can use "getconf word_bit" and "getconf long_bit" to get the number of digits for WORD and LONG, and 32 and 64 for 64-bit systems respectively.
The reference code is as follows:
Copy Code code as follows:
Ldconfig
If [$ (getconf word_bit) = ' $ '] && [$ (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
Other method One: Execute command file/sbin/init
Copy Code code as follows:
[Root@localhost jianbao]# File/sbin/init
/sbin/init:elf 32-bit LSB Shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for gnu/li Nux 2.6.18, stripped
That is 32-bit Linux, if 64-bit, the display is 64-bit.
For example, the result of running on another 64-bit machine:
Copy Code code as follows:
[Root@edunosql ~]# File/sbin/init
/sbin/init:elf 64-bit LSB Shared Object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for Gnu/linux 2 .6.18, stripped
Method Two: 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 bits: Linux demolinux 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 19:59:55 UTC 2014 x86_64 x86_64 x86_64 gnu/linux
method Three: Use "getconf word_bit" and "getconf long_bit" to get WORD and LONG number of digits, 64-bit system should be 32 and 64 respectively.