Skip to content

Instantly share code, notes, and snippets.

@hfan22
Created March 23, 2020 21:27
Show Gist options
  • Save hfan22/51124dd28c4f8c51a1882831c7ac4845 to your computer and use it in GitHub Desktop.
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?
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