Posted By

zingo on 02/09/08


Tagged

osx cli temperature monitor


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

AzizLight
yakafokon
IsraelTorres
jleggat


Get Temperature on OSX


 / Published in: Bash
 

  1. ioreg -n IOHWSensor | awk '/location/ || /current-value/ || /"type"/' | sed -e 's/[^"]*"//' -e 's/" =//' -e 's/location//' -e 's/type//' -e 's/"//g' | awk '{ d=($2/65536); if ($1=="current-value") print substr(d,1,7) "\t" ; if ($1!="current-value") print $0 }' | sed -e 's/temperature/Celsius/' -e 's/voltage/volts/' -e 's/fanspeed/fan RPM/' -e 's/current/Amps/' -e 's/^temp$//' -e 's/ //' | awk '{ if ((NR % 3) == 0) print $0; else printf $0 " " }'

Report this snippet  

You need to login to post a comment.