title: How do I sum all numbers from output of jq
body: <p>I have this command that I would like to sum all the numbers from the output. </p>
  
  <p>The command looks like this</p>
  
  <pre><code>$(hadoop fs -ls -R /reports/dt=2018-08-27 | grep _stats.json | awk '{print $NF}' | xargs hadoop fs -cat | jq '.duration')
  </code></pre>
  
  <p>So it's going to list all the folders in <code>/reports/dt=2018-08-27</code> and get only <code>_stats.json</code> and pass that through <code>jq</code> from <code>hadoop -cat</code> and get only <code>.duration</code> from the json. Which in the end I get the result like this.</p>
  
  <pre><code>1211789 1211789 373585 495379 1211789
  </code></pre>
  
  <p>But I would like the command to sum all those numbers together to become <code>4504331</code></p>