Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there a command I can run from the command line in OS X to get the current CPU temperature and/or the fan speed(s)?

To be more specific, I'd like to be able to get the same info available in the iStat widget under the Fans and Temps tabs on the command line.

I'd like to be able to find these values at the command line so it could be scripted and plugged into a monitoring setup on my Mac - I have a data-nerd desire to collect and graph these values (and other stats) on my Macbook over time.

On Linux, it seems like this would be possible by reading a pseudo-file under the /proc directory, but I'm not sure how to do the equivalent on OS X (if it exists).

share|improve this question

4 Answers 4

up vote 16 down vote accepted

Update: @PressingOnAlways has notified me that this software is now considered legacy by its developer. Further details on the stopped support can be found on their legacy-software website.

Assuming you installed it in /Applications you'd need to run the following:

/Applications/TemperatureMonitor.app/Contents/MacOS/tempmonitor -c -l -a

Site: Temperature Monitor

share|improve this answer
1  
Thanks for this. I take it if I need to install this third-party app for it, there isn't a known built-in way to do the same? –  matt b Jun 21 '12 at 15:30
2  
No, I don't think there is. I've used that same program to display the values with Geektool for a time but didn't find any information about a built-in tool. Mind you that that was more than a year ago, so there ,ight be now. I doubt it though. –  GhostLyrics Jun 21 '12 at 22:31
2  
Note TemperatureMonitor does not support any Macs made after October 2013, or so it told me when I tried to run it on my MacBookPro Retina. –  Paul Jul 30 '14 at 2:29
2  
As of Oct 1st, Temperature Monitor has been suspended - they went "Pro". –  eduncan911 Oct 21 '14 at 19:54
2  
this no longer is viable as this software is no longer kept up to date. –  PressingOnAlways May 13 at 0:50

The iStats ruby gem lets you see the CPU temperature via the command-line.

Installation

$ gem install iStats

Usage

$ istats

Screenshot

share|improve this answer
    
sudo gem install iStats failed on brand new MBP Mavericks. Error looks like this: hastebin.com/lihaqiyeyu.vhdl –  trusktr May 8 '14 at 6:15
    
Unfortunately that's a known error. If you take a look at the Github repo there's a note about it. You can either install Ruby using RVM or brew or use this command to install the gem instead: sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install iStats –  Chris911 May 8 '14 at 6:19
    
Awesome, works like a charm (nice sparklines too). Just had to do it with "sudo" –  laander Sep 3 '14 at 15:09
1  
For live updates: watch -n0 istats (I had to brew install watch on OSX before doing the above) See: superuser.com/q/361902 –  jasonszhao Jun 22 at 2:36
1  
To get rid of display errors use this: watch --color istats. –  mcb Jun 28 at 15:40

This open source command line utility worked for me: https://github.com/lavoiesl/osx-cpu-temp.

share|improve this answer
    
I thought it will be harder to compile this, but it's not! Works like a charm! –  Áron Lőrincz Jul 17 at 20:37

On BSD systems, the sysctl utility can provides similar information as the /proc tree in Linux. It actually report some CPU/GPU temperature information from Xnu CPU Power Management (XCPM):

sysctl machdep.xcpm.cpu_thermal_level
sysctl machdep.xcpm.gpu_thermal_level

However this doesn't seem to be a temperature reading but only an indication of the temperature level compared to some reference.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.