How to detect a Mac's model?

command-line
darwin
unix
mac

(Dmitry Fedyuk) #1
sysctl hw.model

04

Another way:

system_profiler SPHardwareDataType | grep "Model Identifier"

05

apple.stackexchange.com/a/98086