Linux system View System is a 32-bit or 64-bit method summary

Source: Internet
Author: User

This blog is a summary, summed up to see whether the Linux system is 32-bit or 64-bit methods, a lot of content from online netizens blog. This article is just to tidy up, comb this knowledge, easy to forget the time to check at any time.

Method 1:getconf long_bit View

As shown in the following example: 32-bit Linux systems show 32, 64-bit Linux systems display 64. The simplest and quickest way.

[Email protected] ~]# getconf long_bit

32

[Email protected] ~]# getconf long_bit

64

Method 2:uname command View

As the following example shows, x86_64 represents a 64-bit system, and i686 i386 represents a 32-bit system. i686 is only a subset of the i386, supported CPUs starting from Pentium 2 (686), the previous model is not supported.

[Email protected] ~]# uname-a

Linux db-server 2.6.18-194.el5 #1 SMP Tue Mar 21:52:43 EDT all i686 i686 i386 gnu/linux

[Email protected] ~]# uname-m

i686

[Email protected] ~]# uname-a

Linux gettestlnx01 3.8.13-16.2.1.el6uek.x86_64 #1 SMP Thu Nov 7 17:01:44 PST-x86_64 x86_64 x86_64 Gnu/linux

[Email protected] ~]# uname-m

x86_64

Method 3: Arch Command view

[Email protected] ~]# Arch

i686

[Email protected] ~]# Arch

x86_64

Method 4: View the File command

[Email protected] ~]# 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

[Email protected] ~]#

[Email protected] ~]#

[Email protected] ~]# 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 Li BS), for Gnu/linux 2.6.9, stripped

[Email protected] ~]# 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

[Email protected] ~]#

[Email protected] ~]#

[Email protected] ~]# File/bin/ls

/bin/ls:elf 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for Gnu/linux 2.6.18, Stripped

Method 5: This method comes from David's blog and checks the CPU for information to determine if the Linux system is a 64-bit operating system. If the result is greater than 0, the description supports 64bit calculations. LM refers to long mode, which supports LM while it is 64bit.

[Email protected] ~]# Cat/proc/cpuinfo | grep Flags | grep ' LM ' | Wc-l

0

[Email protected] ~]# Cat/proc/cpuinfo | grep Flags | grep ' LM ' | Wc-l

6

References:

http://www.cnblogs.com/dingchenghong/archive/2012/06/29/2569456.html

http://blog.csdn.net/tianlesoftware/article/details/6267115

Http://www.cnblogs.com/JemBai/archive/2012/05/25/2517783.html

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.