Apple - Get fan speed from terminal without spindump or third party software
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