How can I move matching files into another directory?

bash, file, linux, shell

Solution

What about:

find /Directory -name \*.jpg -exec mv {} /Directory \;

That should work.

Problem

I need to move thousands of images: ``` /Directory/0000/000000.jpg /Directory/..../.......jpg /Directory/ZZZZ/ZZZZZZ.jpg ``` to a flat directory: ``` /Directory/000000.jpg /Directory/.......jpg /Directory/ZZZZZZ.jpg ``` How can I do this? Essentially I'm looking for something like this: (but, you know, actually works) ``` mv -r /Directory/*/*.jpg /Directory ```

Original source