Home > Article > Operation and Maintenance > Determine whether linux is 64-bit or 32-bit
Method 1:
getconf LONG_BIT
Enter the getconf LONG_BIT command in the Linux terminal. If it is a 32-bit machine, the result will be 32.
For example:
[root@localhost ~]# getconf LONG_BIT 32
If it is a 64-bit machine, the result is 64.
[root@localhost ~]# getconf LONG_BIT 64
Method 2:
uname -a
If it is a 64-bit machine, x86_64 will be output.
[chenzhou@testweb01 ~]$ uname -a Linux testweb01 2.6.18-308.4.1.el5 #1 SMP Tue Apr 17 17:08:00 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
You can see that x86_64 is output in the execution result of uname-a, indicating that the machine is 64-bit, otherwise it means that the machine is 32-bit.
[root@localhost ~]# uname -a Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux
Recommended tutorial: linux tutorial
The above is the detailed content of Determine whether linux is 64-bit or 32-bit. For more information, please follow other related articles on the PHP Chinese website!