Reprint: Check whether the Linux system version is 32-bit or 64-bit

Source: Internet
Author: User

One

[ROOT@LINUXZGF ~] #getconf long_bit
[ROOT@LINUXZGF ~] #getconf word_bit
(the int and long types in a 32-bit system are generally 4 bytes, and the int type in the 64-bit system is still 4 bytes, but LONG has become a 8-byte inux "getconf word_bit" and "getconf long_bit" are available in the system Gets the number of digits for word and long. 64-bit systems should be 32 and 64, respectively. )

Two

[ROOT@LINUXZGF ~] #uname-A
If there's a x86_64, it's 64, and there's no 32-bit.
The following is X686 or x86_64 the kernel is 64 bits, i686 or i386 the kernel is 32 bits

Three

Look directly at the method that has no/lib64. 64-bit system will have/lib64 and/lib two directories, 32 bits only/lib one.

Four

[ROOT@LINUXZGF ~] #file/sbin/init
/sbin/init: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
32-bit is the 32-bit Linux, 64-bit, which shows the 64-bit

Five

[ROOT@LINUXZGF ~] #file/bin/cat
/bin/cat:elf 32-bit LSB executable, Intel 80386, version 1 (SYSV), for Gnu/linux 2.6.9, dynamically linked (uses shared L IBS), for Gnu/linux 2.6.9, stripped
32-bit is the 32-bit Linux, 64-bit, which shows the 64-bit

Six

[ROOT@LINUXZGF ~] #uname-M
x86_64
3.# Arch
x86_64
i686

Seven, to see how many bits of CPU

[ROOT@LINUXZGF ~] #more/proc/cpuinfo

Eight

[ROOT@LINUXZGF ~]# Echo $HOSTTYPE
x86_64

The getconf command also obtains basic configuration information about the system, such as the number of operating system bits, memory size, disk size, and so on.
$getconf-A to see detailed system Information

Reprint: Check whether the Linux system version is 32-bit or 64-bit

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.