In a directory, how can we find all the files whose base names are the same, but their extension names are not? E.g. 0001.jpg
and 0001.png
and 0001.tiff
, and 0002.jpg
and 0002.png
.
Find files whose basenames are the same, but their ext names are not
filenames
Best Answer
If you want all the unique filenames, here you go:
If you want the files such that more than one of those has the same basename, then use:
For filenames with multiple periods, use the following: