Also:You can see the CPU temperature, voltage and frequency using the 'vcgencmd' command.
Code:
cat /sys/devices/virtual/thermal/thermal_zone0/tempCode:
#!/bin/bash# without the sleep 100 ms, the freq is always maxsleep 0.1sfreq=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq)temp=$(cat /sys/devices/virtual/thermal/thermal_zone0/temp)gov=$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor)[[ -f /sys/devices/platform/cooling_fan/hwmon/hwmon2/pwm1 ]] && pwm=$(cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/pwm1)[[ -f /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input ]] && fan=$(cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input)echo "CPU temp : $(( temp / 1000 ))°C"echo "CPU freq : $(bc <<< "scale=0; $freq/1000") MHz with $gov"[[ -n $fan ]] && echo "Fan : $fan [$pwm]"Statistics: Posted by graysky — Sat Mar 16, 2024 5:46 am