LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   copy contents of many directories in a directory (http://www.linuxquestions.org/questions/linux-general-1/copy-contents-of-many-directories-in-a-directory-933035/)

Nitesh Agarwal 03-06-2012 10:00 AM

copy contents of many directories in a directory
 
I have a folder music which contains subfolders eminem, the beatles, ACDC,etc..... These subfolders contains .mp3 files.
How do i copy all these .mp3 files to a different folder collection using shell.

weibullguy 03-06-2012 10:04 AM

Assume source directory is $HOME/music and destination directory is $HOME/new_music,
Code:

find $HOME/music -name '*.mp3' -exec cp {} $HOME/new_music/ \;


All times are GMT -5. The time now is 08:13 PM.