I am trying to get a simplified output of the cpu frequency to 3 digits, such that if the frequency is less than 1000 it will output xxx Mhz
and if it's above 1000 it will outpute x.xx Ghz
. I can get only the frequency with lscpu | sed -n 's/CPU MHz:[ \t]*//p'
, and the first 4 digits with lscpu | sed -n 's/CPU MHz:[ \t]*//p' | cut -c1-4
, however I'm not sure how to parse this to achieve the desired result.
↧
Get human readable cpu frequency
↧