$ /usr/sbin/system_profiler SPHardwareDataType
Hardware:
Hardware Overview:
Model Name: iMac
Model Identifier: iMac7,1
Processor Name: Intel Core 2 Duo
Processor Speed: 2.4 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache: 4 MB
Memory: 4 GB
Bus Speed: 800 MHz
You can get this from the
system_profiler
tool:or, if you want to go low-level, use
sysctl
:Or to capture the values in a script (credit: @bleater):
btw, there are a bunch of other interesting things you can get from
sysctl
. Try:to see a few of them
The following works in OS X Lion: