I'm looking for a POSIX shell/bash command to determine if the OS architecture is 386
, amd64
, arm
, or arm64
?
Find CPU architecture type in command prompt Open a new command prompt. Type echo %PROCESSOR_ARCHITECTURE% and hit the Enter key. The output includes one of the following values: x86 for a 32-bit CPU, AMD64 for a 64-bit CPU, or ARM64. You can close the command prompt if you want.
On a linux system, you can easily, although not truly definitively, check by examining a common executable: > which bash /bin/bash > file /bin/bash /bin/bash: ELF 32-bit LSB executable, ARM, version 1 (SYSV) ... I say "not definitively" because it is possible to run 32-bit executables on a 64-bit system.
1 – Using the terminal This is shown in the second line above which starts with architecture. Here you can see that it is x86_64. If you see : x86, i686 or i386 then your OS is 32-bit otherwise if you found x86_64 , amd64 or x64 then your Ubuntu is 64-bit based.
For the Android version, look at the OS version under the Device section. This explicitly displays the version number. For architecture info, slide over to the System tab and check out the CPU Architecture and Instruction Sets entries under the Processor tab.
They are 64-bit extensions of two different 32-bit computer architectures. AMD64 is an extension by AMD of the Intel x86 architecture, which has now been adopted by Intel and become standard across all such processors. ARM64 is an extension by ARM of its own 32-bit architecture, which is of course used by its high end processors.
If it's x64, then it's AMD64, if it's x86, then it's i386 :) If you are unable to find “This PC” on your desktop, then open the start menu, then click on the settings icon, then click on “System”, then click on “About”, and you should be able to see the 'system type' there.
The output includes one of the following values: x86 for a 32-bit CPU, AMD64 for a 64-bit CPU, or ARM64. You can close the command prompt if you want. It is worth mentioning that while there are plenty of 32-bit only devices in use, they no longer being produced and superseded by x64 processors.
ARM64, also known as ARMv8-A, is the 64-bit version of the advanced risc machine (ARM) architecture primarily designed for smartphones and interconnected devices. AMD64 is the 64-bit extension of the popular x86 architecture which was originally developed by Intel.
uname -m
prints values such as x86_64
, i686
, arm
, or aarch64
.
I suggest using:
dpkg --print-architecture
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With