Get Extended CPU Information from the Command Line

Apr 28, 2012 - 2 Comments

Get extended CPU information from the command line

Using sysctl we can get extended information on a Macs processor, covering everything from CPU brand and identifier, clock speed, number of cores, thread count, thermal sensor data, cache size, and some significantly more technical information.

This is a handy way to get detailed processor specs and info without turning to the system profiler in OS X, as the entire task is handled from the command line.

To get started, launch the Terminal and enter the following command variation of ‘sysctl’, you’ll pipe the results into grep to clean up the output for CPU details like so:

sysctl -a | grep machdep.cpu

An example and limited sample of the output of this command may look something like the following:

$ sysctl -a | grep machdep.cpu
machdep.cpu.max_basic: 13
machdep.cpu.max_ext: 2147483656
machdep.cpu.vendor: GenuineIntel
machdep.cpu.brand_string: Intel(R) Core(TM)2 Duo CPU P8600 @ 2.40GHz
machdep.cpu.family: 6
machdep.cpu.model: 23
machdep.cpu.extmodel: 1
machdep.cpu.extfamily: 0
machdep.cpu.stepping: 10
machdep.cpu.feature_bits: 3219913727 67691517
machdep.cpu.extfeature_bits: 537921536 1
machdep.cpu.signature: 67194
machdep.cpu.brand: 0
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 DTES64 MON DSCPL VMX SMX EST TM2 SSSE3 CX16 TPR PDCM SSE4.1 XSAVE
machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF
machdep.cpu.logical_per_package: 2
machdep.cpu.cores_per_package: 2

As you can see, there are extensive details about CPU information here, some of which is much more detailed than what you’d find in the system profiler of OS X anyway.

The sysctl command is fairly powerful and can provide extensive technical information, we have used it before to get basic processor information, see if a Mac is 64 bit compatible, discover the precise boot, sleep, and wake times of a Mac, find CPU clock speed, and to get assorted other tidbits about Macs hardware.

Thanks for the tip nicentral

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Command Line, Mac OS X, Tips & Tricks

2 Comments

» Comments RSS Feed

  1. Tom Fischer says:

    Why use “-a | grep machdep.cpu”, when the following command does the job a little more efficiently:

    sysctl machdep.cpu

    tom

    • Paul says:

      Thanks Tom, tried that out and it worked perfectly. Even reveals thermal information about CPU! Cool!

      Sample output:

      $ sysctl machdep.cpu
      machdep.cpu.max_basic: 20
      machdep.cpu.max_ext: 2147483656
      machdep.cpu.vendor: GenuineIntel
      machdep.cpu.brand_string: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
      machdep.cpu.family: 6
      machdep.cpu.model: 61
      machdep.cpu.extmodel: 3
      machdep.cpu.extfamily: 0
      machdep.cpu.stepping: 4
      machdep.cpu.feature_bits: 9221959987971750911
      machdep.cpu.leaf7_feature_bits: 35399595
      machdep.cpu.extfeature_bits: 1241984796928
      machdep.cpu.signature: 198356
      machdep.cpu.brand: 0
      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 DTES64 MON DSCPL VMX EST TM2 SSSE3 FMA CX16 TPR PDCM SSE4.1 SSE4.2 x2APIC MOVBE POPCNT AES PCID XSAVE OSXSAVE SEGLIM64 TSCTMR AVX1.0 RDRAND F16C
      machdep.cpu.leaf7_features: SMEP ERMS RDWRFSGS TSC_THREAD_OFFSET BMI1 AVX2 BMI2 INVPCID RDSEED ADX SMAP
      machdep.cpu.extfeatures: SYSCALL XD 1GBPAGE EM64T LAHF LZCNT PREFETCHW RDTSCP TSCI
      machdep.cpu.logical_per_package: 16
      machdep.cpu.cores_per_package: 8
      machdep.cpu.microcode_version: 32
      machdep.cpu.processor_flag: 6
      machdep.cpu.mwait.linesize_min: 64
      machdep.cpu.mwait.linesize_max: 64
      machdep.cpu.mwait.extensions: 3
      machdep.cpu.mwait.sub_Cstates: 286531872
      machdep.cpu.thermal.sensor: 1
      machdep.cpu.thermal.dynamic_acceleration: 1
      machdep.cpu.thermal.invariant_APIC_timer: 1
      machdep.cpu.thermal.thresholds: 2
      machdep.cpu.thermal.ACNT_MCNT: 1
      machdep.cpu.thermal.core_power_limits: 1
      machdep.cpu.thermal.fine_grain_clock_mod: 1
      machdep.cpu.thermal.package_thermal_intr: 1
      machdep.cpu.thermal.hardware_feedback: 0
      machdep.cpu.thermal.energy_policy: 1
      machdep.cpu.xsave.extended_state: 7 832 832 0
      machdep.cpu.arch_perf.version: 3
      machdep.cpu.arch_perf.number: 4
      machdep.cpu.arch_perf.width: 48
      machdep.cpu.arch_perf.events_number: 7
      machdep.cpu.arch_perf.events: 0
      machdep.cpu.arch_perf.fixed_number: 3
      machdep.cpu.arch_perf.fixed_width: 48
      machdep.cpu.cache.linesize: 64
      machdep.cpu.cache.L2_associativity: 8
      machdep.cpu.cache.size: 256
      machdep.cpu.tlb.inst.large: 8
      machdep.cpu.tlb.data.small: 64
      machdep.cpu.tlb.data.small_level1: 64
      machdep.cpu.address_bits.physical: 39
      machdep.cpu.address_bits.virtual: 48
      machdep.cpu.core_count: 2
      machdep.cpu.thread_count: 4

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates