How to tell if the system is a 32-bit or 64-bit Linux system

Source: Internet
Author: User

How to tell if the system is a 32-bit or 64-bit Linux system

A day, need to download an installation package, suddenly forget their system is 32-bit or 64-bit system, the moment can not think how to view when 32 or 64, hehe, under the Baidu, there are many ways to find here, record, convenient for future inquiries:

The first type:

1
2
3
4
5
[Root@CentOS62 ~]# uname-m
i686

[Root@436704 ~]# uname-m
x86_64

The second type:

1
2
3
4
5
[Root@CentOS62~]# File/sbin/init
/sbin/init:elf32-bit LSB SharedObject, Intel80386, version1(SYSV), dynamically linked  (uses shared Libs) , for gnu/linux 2.6.18, stripped

Span class= "br0" >[root@436704 ~]< Span class= "co1" ># file/sbin/init
/sbin/init:elf 64-bit LSB shared  object, x86-64, version  1  (Sysv, dynamically Linked  (uses gkfx libs) , for  gnu/linux 2.6.18, stripped

The third type:

1
2
3
4
5
[Root@CentOS62~]# File/bin/cat
/bin/cat:elf32-bit LSB Executable, Intel80386, version1(SYSV , dynamically linked  (uses shared Libs , for gnu/linux 2.6.18  stripped

[root@436704  ~]# file/bin/cat
/bin/cat:elf  64-bit LSB executable, x86-64, version < Span class= "nu0" >1  (Sysv, dynamically linked   (uses gkfx libs) , for  Gnu/linux 2.6.18, stripped

The fourth method:

1
2
3
4
5
6
7
[Root@436704 ~]# echo $HOSTTYPE
x86_64

[Root@CentOS62 ~]# echo $HOSTTYPE
I386

;

Hey, the above methods are very simple, it is a look to know

In fact, there is one of the simplest way, is to see if there is no lib64 this folder, the general 64-bit system must have lib64 this folder, hehe, finally there is a method, it does not look very intuitive, but also introduced:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[root@436704 ~ # getconf long_bit
64
[root@436704 ~]# getconf word_bit
32

above is 64-bit system

----------------------------------------

[root @CentOS62  ~# getconf long_bit
32
[root@ Centos62 ~]# getconf word_bit
32

above is the 32-bit system, this does not look very intuitive, hehe ...

 

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.