Created
July 5, 2020 11:21
-
-
Save midibyte/beb6a9e729a709d75c7212323e6b518b to your computer and use it in GitHub Desktop.
Get some simple CPU and GPU info for a Raspberry Pi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# @midibyte | |
# (^ V ^) | |
# tested on Rpi zero W | |
min_freq=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq) | |
max_freq=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq) | |
current_freq=$(sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq) | |
cpu=$(</sys/class/thermal/thermal_zone0/temp) | |
echo "-------------------------------------------" | |
echo "-------------------------------------------" | |
echo "$(date) @ $(hostname)" | |
echo "-------------------------------------------" | |
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)" | |
echo "CPU => $((cpu/1000))'C" | |
echo "-------------------------------------------" | |
echo "-------------------------------------------" | |
echo "Min Freq CPU:" $((min_freq / 1000)) "Mhz" | |
echo "Max Freq CPU:" $((max_freq / 1000)) "MHz" | |
echo "Current Freq CPU:" $((current_freq / 1000)) "MHz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment