title: grep with wc -l caching the count
body: <p>I noticed when doing a row count using below command multiple times cached results is shown, any ideas why?</p>
  
  <pre><code>grep "xxx" "filename.log" | wc -l
  </code></pre>
  
  <p>This returns the count value when run first time, If run again it still gives the same count value, even though the file has more matching values.</p>
  
  <p>what could be the reason. </p>
  
  <p>PS - I am using ubuntu 16.04 LTS</p>
  
  <p>Update - <code>grep -c "xxx" filename.log</code> is returning the correct count. Still wondering why the command above don't give updated result. </p>
  
  <p>How to ensure the buffers are written to file at regular intervals?</p>
  
  <p>FYI - I am checking this on a nginx access log file, which is continously being updated with the request calls, with average write speed of <code>10 lines/sec.</code></p>