I have a image directory with many more subdirectories that contain images with, let's say random, filenames.
images/black-shoe/gsafdfs.jpg images/black-shoe/ggdfgdf.jpg images/black-shoe/gdfgd3f.jpg images/black-shoe/g4twegd.jpg images/red-shoe/ggsdgdfs.jpg images/red-shoe/gskjhkhf.jpg images/red-shoe/gsakytfs.jpg
And I want to batch rename all images to their parent directory but to prevent one overwriting the other, add a suffix like so.
images/black-shoe/black-shoe-1.jpg images/black-shoe/black-shoe-2.jpg images/black-shoe/black-shoe-3.jpg images/black-shoe/black-shoe-4.jpg images/red-shoe/red-shoe-1.jpg images/red-shoe/red-shoe-2.jpg images/red-shoe/red-shoe-3.jpg
I use Debian 8 and am familiar with using the command line. Ideally I'd like small script or oneliner that I can execute from within images/ to apply them on all sub dirs at once.