Check CPU Temperature Using Sysctl in Terminal

cputemperatureterminal

I'm trying to get CPU temperature from the terminal using sysctl.

Command:

sysctl machdep.xcpm.cpu_thermal_level

Output:

machdep.xcpm.cpu_thermal_level: 0

But the given temperature is not correct(Original temperature is: 51c).

How does the temperature is calculated by sysctl? Sometimes the temperature is 0.

Why the temperature is wrong?

Thank you.

Best Answer

I think that's the CPU throttling, not temp - see here: -

What does machdep.xcpm.cpu_thermal_level mean?

This shows your temps:-

sudo powermetrics --samplers smc