title: How can I copy a list of files with spaces in Linux terminal
body: <p>I have my Windows HDD mounted in <strong>/media</strong> in Ubuntu 16.04 LTS. In my terminal, I have navigated to the path <strong>/media/me/OS/Users/Me/Music</strong>. From here, I run a find command to search for all MP3s in this Windows path:</p>
  
  <pre><code>find . -type f -name *.mp3
  </code></pre>
  
  <p>This returns a bunch of .mp3 file paths (colors mean nothing; must have happened through the wiki formatting):</p>
  
  <pre><code>./iTunes/iTunes Music/Yeah Yeah Yeahs/It's Blitz/01 Skeletons.mp3
  ./iTunes/iTunes Music/Yeah Yeah Yeahs/It's Blitz/Gold Lion.mp3
  ./iTunes/iTunes Music/Yeah Yeah Yeahs/It's Blitz/Heads Will Roll.mp3
  ./iTunes/iTunes Music/Yeah Yeah Yeahs/It's Blitz/Maps.mp3
  </code></pre>
  
  <p>As you can see, there are spaces in the file names. My goal here is to copy all the files in the list (560 or so of them) to my Ubuntu HDD's <strong>/home/me/Music</strong> directory. Below is a list of things I've tried, all which end up with the terminal yelling at me that it can't find "./iTunes/iTunes", "Music/Yeah", "Yeah"...you get the idea.</p>
  
  <p>Things I've tried:</p>
  
  <ol>
  <li><code>for f in $(find . -name *.mp3); do cp $f ~/Music/WindowsMP3s/; done</code></li>
  <li><code>find . -type f -name *.mp3 &gt; output.txt</code> and then <code>while read file; do cp $file ~/Music/WindowsMP3s/; done &lt;output.txt</code></li>
  </ol>
  
  <p>I've tried surrounding the filename in grave accents (`) in the for loops and in the output.txt file itself. I've even tried editing output.txt with 1 and 2 backslashes in front of every space.</p>
  
  <p>Any ideas would be great!</p>
  
  <p>P.S. Yes, I know I can just do this all through the file manager and copy them to a external hard drive and then copy them to Ubuntu but where's the fun in that?! :)</p>