title: How to add progress bar to a somearchive.tar.xz extract
body: <p>I'd like to print at the very least print # files extracted, from running a tarball extract</p>
  
  <pre><code>xz -dc /path/to/somearchive.tar.xz | sudo tar xvpf - -C /path/to/some_directory
  </code></pre>
  
  <p>I was thinking of using the "\r" as mentioned in <a href="https://stackoverflow.com/questions/238073">this question</a>, for instance</p>
  
  <pre><code>num=0
  when [\n received]
      num=$(($num + 1))
      echo -ne "$num files extracted \r"
  end when
  </code></pre>
  
  <p>my bash skills fail me.</p>