How to check whether the system is 32-bit or 64-bit in CentOS

Source: Internet
Author: User

How to check whether the system is 32-bit or 64-bit in CentOS
1. View from the system
1.1 uname-a command
[Root @ qs-dmm-rh2 ~] # Uname-
Linux qs-dmm-rh2 2.6.18-194. el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux

[Root @ qs-xezf-db2 ~] # Uname-
Linux qs-xezf-db2 2.6.18-194. el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux


1.2 file/bin/ls command
[Root @ qs-dmm-rh2 ~] # File/bin/ls
/Bin/ls: 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

[Root @ qs-xezf-db2 ~] # File/bin/ls
/Bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs ), for GNU/Linux 2.6.9, stripped


1.3 getconf LONG_BIT command
[Root @ qs-dmm-rh2 ~] # Getconf LONG_BIT
32

[Root @ qs-xezf-db2 ~] # Getconf LONG_BIT
64

1.4 arch command
[Root @ qs-dmm-rh2 ~] # Arch
I686

[Root @ qs-xezf-db2 ~] # Arch
X86_64




2. View from CPU
[Root @ qs-dmm-rh2 ~] # Cat/proc/cpuinfo | grep flags | grep 'lm '| wc-l
0

[Root @ qs-xezf-db2 ~] # Cat/proc/cpuinfo | grep flags | grep 'lm '| wc-l
8

If the result is greater than 0, 64bit computing is supported. lm indicates long mode, and lm indicates 64bit.

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.