title: Find and copy files with relative path
body: <p>At this <a href="https://stackoverflow.com/questions/5241625/find-and-copy-files">Stackoverflow question</a>, it shows how to copy files and it will recurse into subdirectories to copy files. How do I copy files and include the relative path in the copy?</p>
  
  <p>For instance, </p>
  
  <p><code>find /path/to/directory/or/just/dot -name '*somepartoffilename*' -exec cp {} /path/you/want/to/copy/to  \;</code></p>
  
  <p>So if you have <code>/path/to/directory/a/somepartoffilename.txt</code> and <code>/path/to/directory/b/somepartoffilename.txt</code>, you'll only end up with one of those files in <code>/path/you/want/to/copy/to</code>.</p>