Tuesday, August 26, 2014

Shell script to check Raspberry Pi CPU frequency

The following command show the CPU current frequency:

$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

Create a shell script, chkspeed.sh, with content:

cur_freq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
echo Current CPU Freq.= $(($cur_freq/1000)) "(Mhz)"

To make it executable:

$ sudo chmod +x chkspeed.sh

Run it:

$ ./chkspeed.sh

No comments: