Created
March 23, 2020 21:27
-
-
Save hfan22/51124dd28c4f8c51a1882831c7ac4845 to your computer and use it in GitHub Desktop.
shell/bash command to determine if the OS architecture is 386, amd64, arm, or arm64?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
architecture="" | |
case $(uname -m) in | |
i386) architecture="386" ;; | |
i686) architecture="386" ;; | |
x86_64) architecture="amd64" ;; | |
arm) dpkg --print-architecture | grep -q "arm64" && architecture="arm64" || architecture="arm" ;; | |
esac | |
------------------------------------------------------- | |
uname -m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment