title: Disk usage of files whose names match a regex, in Linux?
body: <p>So, in many situations I wanted a way to know how much of my disk space is used by what, so I know what to get rid of, convert to another format, store elsewhere (such as data DVDs), move to another partition, etc. In this case I'm looking at a Windows partition from a <a href="http://www.slitaz.org/" rel="noreferrer">SliTaz Linux</a> bootable media.</p>
  
  <p>In most cases, what I want is the size of files and folders, and for that I use NCurses-based <a href="http://dev.yorhel.nl/ncdu" rel="noreferrer">ncdu</a>:</p>
  
  <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="https://i.stack.imgur.com/N53Vg.png" alt="ncdu"></p>
  
  <p>But in this case, I want a way to get the size of <strong><em>all files matching a regex</em></strong>. An example regex for .bak files:</p>
  
  <pre><code>.*\.bak$
  </code></pre>
  
  <p>How do I get that information, considering a standard Linux with core GNU utilities or <a href="http://busybox.net/about.html" rel="noreferrer">BusyBox</a>?</p>
  
  <p><strong>Edit:</strong> The output is intended to be parseable by a script.</p>