I have files in multiple subfolders, I want to move them all to one folder. Then I like to rename those files.
/foo/A1000-foobar1412.jpg
/foo/A1000-foobar213.jpg
/foo/A1000-foobar314.jpg
/foo1/B1001-foobar113.jpg
/foo2/C1002-foobar1123.jpg
/foo2/C1002-foobar24234.jpg
What I would like to get is:
../bar/A1000-1.jpg
../bar/A1000-2.jpg
../bar/A1000-3.jpg
../bar/B1001-1.jpg
../bar/C1002-1.jpg
../bar/C1002-2.jpg
So what I do so far is:
find . -name "*.jpg" -exec mv {} ../bar/ \;
But now I'm stuck at renaming the files.