Get fan speed from terminal without spindump or third party software

I was wondering if there was a way to access the computer fan speed through terminal. I've heard that you can use software like smcFanControl, but I was wondering if there was a way to do it without any third party software.

Another way i've heard of is using the spindump command, but from what I remember it can take a bit for it to finish.

Is there a way to get the info from terminal almost instantly without using third party software?

Also, is there a command I could possibly use to adjust the fan speed using terminal without any third party software?

I'm using a MacBook Pro 2015 running macOS High Sierra.


Solution 1:

macOS command /usr/bin/powermetrics

sudo powermetrics -i 200 -n1 --samplers smc

output:

**** SMC sensors ****

CPU Thermal level: 0
GPU Thermal level: 0
IO Thermal level: 0
Fan: 1199 rpm
CPU die temperature: 56.30 C
GPU die temperature: 79.00 C

sudo powermetrics -i 200 -n1 --samplers smc | grep "Fan" | sed 's/Fan: //g' # -> 1200 rpm