jamesdcarroll
May 7th, 2009, 06:09 AM
I would like to find all the pictures on my system and copy them to a single folder. I found a little script that will see them out and do that:
find . -name '*.jpg' -type f -exec sh -c 'exec cp -f "$@" /home/jim/AllPictures' find-copy {}
but when it tries to copy files that have the same name as one that's already in the destination folder it won't overwrite which is fine, but I would rather that it make another copy(ie image.jpg, image1.jpg, image2.jpg... etc)
Would it be possible to do that? I know I'm gonna have dupes and will deal with that later. Right now I just want to get everything in one place.
Thanks!
find . -name '*.jpg' -type f -exec sh -c 'exec cp -f "$@" /home/jim/AllPictures' find-copy {}
but when it tries to copy files that have the same name as one that's already in the destination folder it won't overwrite which is fine, but I would rather that it make another copy(ie image.jpg, image1.jpg, image2.jpg... etc)
Would it be possible to do that? I know I'm gonna have dupes and will deal with that later. Right now I just want to get everything in one place.
Thanks!