You are not logged in.
Title says it all. I have a discography folder with subfolders of the different years and albums of a band each containing music, some also have more sub folders. What I want to do is copy all of the music (.mp3's) from all the folders and sub folders into just one music folder. I found a find and -exec cp command before but it did absolutely nothing for whatever reason. Perhaps I did it wrong. Can anyone help me?
Thanks
Last edited by SiegeMachine (2009-11-15 06:54:40)
Offline
mkdir target_dir
find . -type f -exec cp {} target_dir/ \;
Offline
Is there a way to make that just mp3 files? I see the . is what its searching for in the name to copy but technically the files came from a windows program and all have a . in them so its copying everything from all the folders into one. When I put .mp3 though it says no such file or directory.
Offline
. refers to the directory to search (the current directory), it's not a pattern - here's what you want:
find . -iname '*.mp3' -type f -exec cp {} target_dir/ \;
This is assuming you're in the music directory - if not, you want
find /path/to/music -iname '*.mp3' -type f -exec cp {} target_dir/ \;
Last edited by Pox (2009-11-15 06:53:59)
Offline
Thanks a lot!
Offline
No problem
If your issue has been resolved, adding [SOLVED] to the end of the topic title is informative.
Offline