title: Linux's top CPU usage - always the same value
body: <p>Here is my command:</p>
  
  <pre><code>top -b -n 1 | head -3 | tail -n 1 | awk '{ print $2 }'
  </code></pre>
  
  <p>I run a bash script which gets these details (also Load Average and memory consumption) and saves it to a file, which I use to visualise cpu load.</p>
  
  <p>But the above command, shows always the same value!
  ~6%, no matter if the server is under heavy load or idle.</p>
  
  <p>when I run:</p>
  
  <pre><code>top
  </code></pre>
  
  <p>It shows the same value (~6%) at the beginning, and after refresh it shows real value (eg. 80%).</p>
  
  <p>How to fix that, or how to get current cpu usage, which can be used for visualisation?</p>