7

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?

5 Answers 5

4

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.

0
8

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)
4

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!).

2

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))
1
  • On a MacBookAir6,1 there is no temperature sensor neither fanspeed match to find using ioreg -c IOHWSensor -w 0.
    – Pro Backup
    Commented Dec 14, 2016 at 17:14
-1

iStat Menus shows a lot of detailed information about the running state of the system, including all temperature sensors.

2
  • 1
    He wants something without third party app.
    – revolver
    Commented Jul 7, 2013 at 6:13
  • He asked us specifically the temperature of the hardware disk (which the istat/istatistica don't show, this only shows CPU cores temperatures), and he asked for the terminal command (probably because he needs to inspect it remotely by doing some SSH, or for creating some log files in a script), anyway this answer it's not related to the question in both aspects of it. Commented Jul 13, 2023 at 21:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .