Finding out Your Mac Model Identifier

 From a terminal use:

sysctl hw.model

In my case:

hw.model: MacBookPro5,2

Update: This still works on OS X Yosemite:

hw.model: MacBookPro10,1

Written on February 14, 2010