How Linux uses the shell to see if Linux is 32-bit or 64

Source: Internet
Author: User

Now the vast majority of users are using the Windows system, all know that the Windows system has 32-bit and 64-bit, in fact, the Linux system also has 32-bit and 64-bit, you know your Linux system is a few? Here's how you can use the shell to see if Linux is 32-bit or 64-bit.

Manually view the number of system digits

To view the number of Linux system digits, you can perform the following two commands individually

Getconf Word_bit

Used to get the number of digits in Word

Getconf Long_bit

The number of digits used to get long

For 64-bit systems above two commands should be 32 and 64 respectively.

To determine whether the Linux system is 32-bit or 64-bit has a lot of methods, recommended with getconf, however, some people think getconf word_bit=32 is 32bit,getconf word_bit=64 is 64bit, please go to 64bit machine execution, hehe. Getconf word_bit Show results or 32,why?

In a 32-bit system, the int and long types are typically 4 bytes, and the 64-bit system is of type int or 4 bytes, but long has become a 8-byte inux system that can be

Use "getconf word_bit" and "getconf long_bit" to get the digits of WORD and LONG

Shell determines the number of digits in the system

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

Add some other way

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

The above is the Linux use Shell to view the Linux32 bit and 64-bit method introduced, in addition to using the Shell view, you can also manually execute commands to view the number of system bits.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.