I had a bunch of subdirectories within my Music folder with a lot a .mp3 files.   I wanted to copy all of the .mp3 files into one folder and it took a couple of days to find out to do it.

find . -name '*.mp3' -exec cp --target-directory='/home/jeff/Music' '{}' +

You can change the ‘cp’ into a ‘mv’ to move them and not copy.  I sorta understand how it works, but it works.

 

References:

http://unix.stackexchange.com/questions/67503/move-all-files-with-a-certain-extension-from-multiple-subdirectories-into-one-di

Advertisements