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?
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 need to use 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.
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!).
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
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))
iStat Menus shows a lot of detailed information about the running state of the system, including all temperature sensors.