Determine the architecture of a Mac from the command line or script?
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Droplet of life
--
Chapters
00:00 Determine The Architecture Of A Mac From The Command Line Or Script?
00:33 Accepted Answer Score 86
00:43 Answer 2 Score 27
00:53 Answer 3 Score 22
01:08 Answer 4 Score 9
01:36 Thank you
--
Full question
https://superuser.com/questions/148500/d...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#macos #commandline #shellscript #powerpc
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Droplet of life
--
Chapters
00:00 Determine The Architecture Of A Mac From The Command Line Or Script?
00:33 Accepted Answer Score 86
00:43 Answer 2 Score 27
00:53 Answer 3 Score 22
01:08 Answer 4 Score 9
01:36 Thank you
--
Full question
https://superuser.com/questions/148500/d...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#macos #commandline #shellscript #powerpc
#avk47
ACCEPTED ANSWER
Score 86
There are many ways, but try uname -a
.
ANSWER 2
Score 27
uname -m
seems to output the same information as /bin/arch
.
ANSWER 3
Score 22
arch
is available in /usr/bin/arch
You can get OS version information with sw_vers
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.6.3
BuildVersion: 10D573
$ sw_vers -productVersion
10.6.3
ANSWER 4
Score 9
You can use sysctl
to get information about your CPU:
$ sysctl machdep.cpu.brand_string
machdep.cpu.brand_string: Apple M1 Pro
Now you can take this string and search in the internet to get details about this CPU brand.
If you want more information about the CPU you can use this command:
$ sysctl machdep.cpu
machdep.cpu.cores_per_package: 10
machdep.cpu.core_count: 10
machdep.cpu.logical_per_package: 10
machdep.cpu.thread_count: 10
machdep.cpu.brand_string: Apple M1 Pro
machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM PBE SSE3 PCLMULQDQ DTSE64 MON DSCPL VMX EST TM2 SSSE3 CX16 TPR PDCM SSE4.1 SSE4.2 AES SEGLIM64
machdep.cpu.feature_bits: 151121000215084031
machdep.cpu.family: 6