Quantcast
Channel: Active questions tagged bash+awk - Ask Ubuntu
Viewing all articles
Browse latest Browse all 102

Get human readable cpu frequency

$
0
0

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.


Viewing all articles
Browse latest Browse all 102

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>