Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does linux check whether it is 64-bit or 32-bit?

Shulou Source: shulou.com Published: 2022-06-02 21:49:55 10月03日 Update

How does linux check whether it is 64-bit or 32-bit? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Method 1:

Getconf LONG_BIT

Enter the getconf LONG_BIT command in the linux terminal, and if it is a 32-bit machine, the result is 32.

For example:

[root@localhost ~] # getconf LONG_BIT32

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

[root@localhost ~] # getconf LONG_BIT64

Method 2:

Uname-a

If it is a 64-bit machine, it will output x86x64.

[chenzhou@testweb01 ~] $uname-aLinux testweb01 2.6.18-308.4.1.el5 # 1 SMP Tue Apr 17 17:08:00 EDT 2012 x86 "64 GNU/Linux

You can see that the output of x86x64 after uname-an execution indicates that the machine is 64-bit, otherwise it means that the machine is 32-bit.

[root@localhost] # uname-aLinux localhost.localdomain 2.6.18-164.el5 # 1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux on how to check linux is 64-bit or 32-bit questions are shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Tags: Machines methods results questions or more help solutions output easy easy representatives content commands guys partners knowledge articles terminals industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Apple Xiaomi Shulou Tech Info Shulou Information