Check current CPU architecture
Here’s command line to check current CPU architecture, this command I use to check if Mac is ARM or Intel
arch_name="$(uname -m)"
if [ "${arch_name}" = "x86_64" ]; then
if [ "$(sysctl -in sysctl.proc_translated)" = "1" ]; then
echo "Running on Rosetta 2"
else
echo "Running on native Intel"
fi
elif [ "${arch_name}" = "arm64" ]; then
echo "Running on ARM"
else
echo "Unknown architecture: ${arch_name}"
fi
Linked Notes:
Today I learn
I believe that we can learn something new everyday, that’s why I set this page to record what I learn during the day.