title: How can I use xargs to copy files that have spaces and quotes in their names?
body: <p>I'm trying to copy a bunch of files below a directory and a number of the files have spaces and single-quotes in their names.  When I try to string together <code>find</code> and <code>grep</code> with <code>xargs</code>, I get the following error:</p>
  
  <pre><code>find .|grep "FooBar"|xargs -I{} cp "{}" ~/foo/bar
  xargs: unterminated quote
  </code></pre>
  
  <p>Any suggestions for a more robust usage of xargs?</p>
  
  <p>This is on <a href="http://en.wikipedia.org/wiki/Mac_OS_X_Leopard" rel="noreferrer">Mac&nbsp;OS&nbsp;X 10.5.3</a> (Leopard) with BSD <code>xargs</code>.</p>