Check whether the CentOS system version is 32-bit or 64-bit

Source: Internet
Author: User
1. [root @ linuxzgf ~] # GetconfLONG_BIT [root @ linuxzgf ~] # GetconfWORD_BIT (in 32-bit systems, the int and long types are generally 4 bytes, while in 64-bit systems, the int type is 4 bytes, however, long has been changed to 8 bytes available in inux system & quot; getconfWORD_BIT & quot; and & quot; getcon 1,

[Root @ linuxzgf ~] # Getconf LONG_BIT
[Root @ linuxzgf ~] # Getconf WORD_BIT
(In 32-bit systems, the int and long types are generally 4 bytes. in 64-bit systems, the int type is 4 bytes, however, long has been changed to 8-byte inux. "getconf WORD_BIT" and "getconf LONG_BIT" can be used to obtain the number of digits of word and long. In a 64-bit system, the values are 32 and 64 respectively .)

II,

[Root @ linuxzgf ~] # Uname-
If x86_64 is 64-bit, no is 32-bit.
When X686 or X86_64 is followed, the kernel is 64-bit, and i686 or i386 is 32-bit.

III,

Check whether the/lib64 directory is available. The 64-bit system has two directories:/lib64 and/lib. the 32-bit system has only one directory.

IV,

[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 a 32-bit linux. if it is 64-bit, 64-bit is displayed.

V,

[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 libs ), for GNU/Linux 2.6.9, stripped
32-bit is a 32-bit linux. if it is 64-bit, 64-bit is displayed.

VI,

[Root @ linuxzgf ~] # Uname-m
X86_64
3. # arch
X86_64
I686

7. check the number of CPUs

[Root @ linuxzgf ~] # More/proc/cpuinfo

8,

[Root @ linuxzgf ~] # Echo $ HOSTTYPE
X86_64

The getconf command can also obtain basic system configuration information, such as the number of operating systems, memory size, and disk size.
$ Getconf-a: Detailed system information is displayed.
Related Article

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.