title: Grep CPU and other hardware percentage using top command?
body: <p>I need to measure my CPU percentage usage and memory.<br>
  Using top command will give this result (see the red sign)
  <a href="https://i.stack.imgur.com/uibjq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uibjq.jpg" alt="cpu info 1"></a></p>
  
  <p>Another command by typing</p>
  
  <pre><code>top -d 1 | grep -w "CPU"
  </code></pre>
  
  <p>The result is like this.
  <a href="https://i.stack.imgur.com/digU0.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/digU0.jpg" alt="CPU INFO 2"></a></p>
  
  <p>How do i grab the percent value of cpu usage to a variable in bash linux?<br>
  Need help everyone :) <br>
  Many thanks</p>