check temperature macbook code example Example: get mac temperature sudo powermetrics --samplers smc |grep -i "CPU die temperature"