Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect 386, amd64, arm, or arm64 OS architecture via shell/bash

Tags:

I'm looking for a POSIX shell/bash command to determine if the OS architecture is 386, amd64, arm, or arm64?

like image 502
Justin Avatar asked Feb 08 '18 05:02

Justin


People also ask

How do I know if I have AMD64 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.

How do I know if my ARM64 is ARM or Linux?

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.

How do I know if I have AMD64 or ARM64 Ubuntu?

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.

How do I know my ARM architecture?

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.

What is the difference between ARM64 and AMD64?

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.

How do I know if my computer is an AMD64 or i386?

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.

What does x86 and AMD64 mean in the output?

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.

What is AMD64 ARMv8-A?

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.


2 Answers

uname -m 

prints values such as x86_64, i686, arm, or aarch64.

like image 136
ephemient Avatar answered Nov 15 '22 11:11

ephemient


I suggest using:

dpkg --print-architecture 
like image 33
Roman Panaget Avatar answered Nov 15 '22 11:11

Roman Panaget