I'm trying to tidy-up my photos which are, for various historic reasons, scattered all over my system. To enable me to make a start on this task, I've been trying to use the command line to construct a list of all directories that contain one or more jpg files. I'm certain that I don't have to be concerned about looking for other image file formats, but I do have to allow for jpg appearing in upper and lower case.
I'd like each directory name to appear only once in the final list. To provide an example, if I have the following directories each of which contain one or more jpg or JPG files....
~Mike/Pictures ~Mike/Pictures/London/Olympics ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Photos ~Mike/Family History/Swaine
I'd like the results to appear with each directory listed only once - irrespective of the number of image files it might contain - preferably sorted and then written to a file
~Mike/Family History/Swaine ~Mike/Photos ~Mike/Pictures ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Pictures/London/Olympics
My command line skills are just not up to this! I can use a lot of the simpler forms of single commands, but once they get complex and/or have to be piped things tend to go wrong.