Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

check macbook pro temperature by terminal

Hi there,
maybe here i can find some answers to my request posted here:

http://discussions.apple.com/thread.jspa?threadID=2671272&tstart=0

" i am using a macbook pro 5,5 and i want to check the temperature by using my terminal (not using graphical apps).
I think it is possible with "ioreg" command but i cant find anythig on the web that helps me.
Please can you help me?
In any case have i to use an apple script? "

Thank you.

Filippo

MacBook Pro 5.5, Mac OS X (10.6.5)

Posted on Dec 8, 2010 1:12 AM

Reply
34 replies

Dec 8, 2010 5:31 AM in response to JohnAlanWoods

Thank you for your answer but with "ioreg -l IOHWSensor | more" i cannot see the temperatures.
I also tried to run the script you linked:

"
set the_result to (do shell script "ioreg -c IOHWSensor | grep -vE '\\{|\\}|\\+\\-o'")'s paragraphs

set all_display to ""
repeat with i from 0 to 16

set jump to 14
set the_location to item (3 + (jump * i)) of the_result
set the_location to characters 41 thru ((count of characters of the_location) - 1) of the_location as string
set the_type to item (4 + (jump * i)) of the_result
set the_text to item (2 + (jump * i)) of the_result as string
set the_text to characters 44 thru (count of characters of the_text) of the_text as string --(length of item 2 of the_result)
set the_type to characters 37 thru ((count of characters of the_type) - 1) of the_type as string
if the_type = "temperature" then
set all_display to all_display & "
" & the_location & ": " & ((the_text / 65536) * (9 / 5)) + 32 & " F" as string
end if
end repeat

display dialog all_display

"

It doesn't work... maybe because it's referred to a G5 and not with Intel Mac hardware.

Other suggestions?

🙂

Dec 19, 2010 5:56 AM in response to filippo1982

I'm a member, and I checked for you there's nothing on there, the way to do it, is use the ioreg command and parse the output,

Ie run ioreg and pipe it into a script that pulls the relevant data and then do a little math on the temp values

One of the links above has the kinda script you need unfortunately there's no command line tool included in OS X that just outputs what you want

Ie CPU TEMP = x Degrees C
GPU TEMP = y Degrees F


etc.


There are widgets for dashboard and other cocoa apps but I understand this isn't what you want

Jan 11, 2011 3:58 PM in response to filippo1982

filippo1982, [Temperature Monitor|http://www.bresink.de/osx/TemperatureMonitor.html] comes with a command-line executable named [tempmonitor|http://www.bresink.de/osx/216202/Docs-en/commandline.html]. On my MacBookPro5,5, the command line


tempmonitor -ds -c -a -l | grep DIODE | sed -e 's/^[^:]*: //'


returns output in the format of


51 C


Is this the type of output that you’re seeking?

check macbook pro temperature by terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.