I have a directory structure which contains many files. I want to find similar files recursively and sort them based on their names.
The easy part: find all files named
f*.ext and move them to a certain directory, let's say
But now I want to go through the tree again and find all
t*.ext which have a match in
dir1. For example, for
dir1/f12345.jpg find the corresponding
source-tree/t12345.jpg (if it exists) and move it to
In the end, every for every
dir2/t*.ext there should be a
source-tree/t*.ext who don't have a
dir1/f*.ext should remain where they are.