title: How to `scp` directory preserving structure but only pick certain files?
body: <p>I need to secure copy (scp) to remotely copy a directory with its sub structure preserved from the UNIX command line. The sub directories have identically named files that I WANT and bunch of other stuff that I don't. Here is how the structure looks like.</p>
  
  <pre><code>directorytocopy
    subdir1
      1.wanted
      2.wanted
      ...
      1.unwanted
      2.notwanted
    subdir2
      1.wanted
      2.wanted
      ...
      1.unwanted
      2.notwanted
    ..
  </code></pre>
  
  <p>I just want the <code>.wanted</code> files preserving the directory structure. I realize that it is possible to write a shell (I am using bash) script to do this. Is it possible to do this in a less brute force way? I cannot copy the whole thing and delete the unwanted files because I do not have enough space. </p>