How to Tell if Linux is 32-bit or 64-bit

Source: Internet
Author: User

Method One: getconf long_bit

Enter the getconf long_bit command on the Linux terminal

If it is a 32-bit machine, the result is 32

    1. [Email protected] ~]# getconf long_bit
    2. 32

If it is a 64-bit machine, the result is 64

    1. [Email protected] ~]# getconf long_bit
    2. 64

Method Two: Uname-a

If it is a 64-bit machine, it will output x86_64

    1. [Email protected] ~]$ uname-a
    2. Linux testweb01 2.6. 18-308.4. 1.el5 #1 SMP Tue Apr :£ ºEDT x86_64 x86_64 x86_64 gnu/linux

As you can see, the output of x86_64 in the results of the uname-a execution indicates that the machine is 64-bit, otherwise the machine is 32-bit

    1. [Email protected] ~]# uname-a
    2. Linux localhost.localdomain 2.6. 18-164.el5 #1 SMP Tue ::EDT i686 i686 i386 gnu/linux /c5>

Method Three: File/sbin/init or File/bin/ls

Example: 32-bit machine

File/sbin/init

    1. [Email protected] ~]# File/sbin/init
    2. /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

File/bin/ls

    1. [Email protected] ~]# File/bin/ls
    2. /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

Example: 64-bit machine

File/sbin/init

    1. [Email protected] ~]$ File/sbin/init
    2. /sbin/init:elf 64-bit LSB executable, AMD x86-, version 1 (SYSV), for Gnu/linux 2.6. 9, dynamically linked (uses shared libs), for Gnu/linux 2.6. 9, stripped

File/bin/ls

    1. [Email protected] ~]$ File/bin/ls
    2. /bin/ls:elf 64-bit LSB executable, AMD x86-, version 1 (SYSV), for Gnu/linux 2.6. 9, dynamically linked (uses shared libs), for Gnu/linux 2.6. 9, stripped

The 64-bit or 32-bit in the command result can be used to determine whether the machine is 64-bit or 32-bit.

How to Tell if Linux is 32-bit or 64-bit

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.