title: Get each core usage BASH
body: <p>I would like to listen to the CPU usage, by getting each core percentage usage: <code>CPUcore1</code> and <code>CPUcore2</code> in a loop.</p>
  <pre><code>while :
  do
      if [ $CPUcore1 -gt 95 ] &amp;&amp; [ $CPUcore2 -gt 95 ]
      then
          //script..
      fi
  done
  </code></pre>
  <p><code>CPUcore1</code> and <code>CPUcore2</code> should be equal to what present on <code>htop</code></p>
  <p><a href="https://i.stack.imgur.com/BlnR8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BlnR8.png" alt="enter image description here" /></a></p>
  <p>In this example:</p>
  <p><code>CPUcore1</code>=70.0</p>
  <p><code>CPUcore2</code>=44.4</p>
  <p>I know that some calculation should be made in order to evaluate this.</p>