Project

General

Profile

Download (393 Bytes) Statistics
| Branch: | Tag: | Revision:
#!/bin/bash

if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi

NUM_CPUS=$( cat /proc/cpuinfo | grep processor | wc -l )
echo -e $NUM_CPUS" CPUs detected\n\n"

# at /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
for ((idx=0;idx<NUM_CPUS;idx++)); do
printf "\t%02d -- " "$idx";
cat /sys/devices/system/cpu/cpu$idx/cpufreq/cpuinfo_cur_freq
done
(11-11/14)