|
Finding and moving files with find
Hi, this is probably a really basic question, but between the manpage and my Nutshell book and some other sources I'm still not figuring out what I'm doing wrong.
The problem, I unzip some mp3 archives which decompress into a series of sub-directories. I want to move into each sub-directory, pluck out the individual .mp3 files and move them to another directory altogether. What I'm doing looks like this:
noexit@uranus:~/files/Tripping Daisy$ find . -iname '*.mp3' -execdir mv ~/Music/Tripping_Daisy '{}'\; +
Which I think is saying "go into each sub-directory, look for any file with .mp3 in the name, and move it to ~/Music/Tripping_Daisy, then repeat".
What happens though is this:
noexit@uranus:~/files/Tripping Daisy$ find . -iname '*.mp3' -execdir mv ~/Music/Tripping_Daisy '{}'\; +
mv: target `./01 - Field Day Jitters.mp3' is not a directory
mv: target `./05 - Sigmund & The Sea Monsters Theme.mp3' is not a directory
mv: target `./10 - Triangle.mp3' is not a directory
mv: target `./11 - Halo Comb.mp3' is not a directory
mv: target `./11 - Prick.mp3' is not a directory
The directories:
noexit@uranus:~/files/Tripping Daisy$ ls
(1993) - Bill
(1998) - Jesus Hits Like The Atom Bomb
Rares, B-sides
(1995) - I Am An Elastic Firecracker
(1999) - Tripping Daisy
If I just do
find . -iname '*.mp3'
Then it finds and lists each file in each sub-directory, as expected.
I'm using Kubuntu Hardy.
I've tried various combinations and still can't make this work. I've done it in the past so I know I'm missing something, and I don't think it should be terribly complicated. What am I doing wrong or missing?
Thanks for any help,
Rob
|