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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s