I would like to copy all files with a certain extension that are in sub directories to a different folder. I don't want to maintain the directory structure, I just want to copy all files found to a different folder.
I used this command to do it:
cp `find . -name "*.aac"` /media/moasad/New\ Volume/Media\ files/Avengers/Aud/aac/
However, I noticed that If it runs into folders or files with spaces in them the cp
function doesn't know what to do and I get an error something like this:
cp: cannot stat ‘./Temporary_Items/martin/Problem’: No such file or directory
cp: cannot stat ‘Files/nav-YCA136843.aac’: No such file or directory
Notice that its one file: ./Temporary_Items/martin/Problem Files/nav-YCA136843.aac
But because of the space in "Problem Files", it's confused.