Get disk temperature in terminal

Is there a command I can use just to get the hard disk temperature in the terminal?

Is this possible without a third party app?


Note: The tool isn't available any longer, and the replacement hasn't been updated since 2014 (and doesn't seem to work on recent versions of macOS).


Unfortunately you won't be able to do this without a third party app. However, if you're happy to use a third party software it is possible to get the temperature in terminal.

You can temperature monitor, which is a free application and provides a command line option. The ins and outs of using the software may be a bit much to go into here, but you can find all the instructions here.


Without add on software there is no command to get the disk temperature, after:

brew install smartmontools

One can run the following command o retrieve de disk temperature:

$ smartctl -a disk0 | grep Temperature
194 Temperature_Celsius     0x0022   044   044   000    Old_age   Always       -       56 (Min/Max 17/70)

You could try Smartmontools (S.M.A.R.T. Monitoring Tools) which has a command-line app. Most (if not all?) hard drives will report their temperature in the S.M.A.R.T. report.

There's also a native GUI SMARTReporter app which lets you perform certain actions based on temperature, if that's what you're after (and also happens to include the smartctl command-line binary — though if you're just after the binary you should, as a rule, get it from the "original" developers, just to be safe!).


Apple doesn’t program that sensor directly for command line access.

You will only be able to get a temperature reading if there is a sensor. This article explains how you can get this information via the ioreg command.

This one-liner worked for me to get the GPU temperature (unfortunately I was not able to see any other IOHWSensors on my machine):

echo $(($(ioreg -c IOHWSensor | grep "current-value" | grep -oE [0-9]+) / 65536))