I have a linux directory with thousands of files with a variety of different filenames and types. I want to find all the files where the filenames start a certain way eg "xx_xxxx_xx...", I want to copy/clone those files into the same directory with a new suffix attached to the end of the filename. The filenames all have the same starts and a different end and I don't have a list of them in another file.
I haven't found a good method for loping through a set of files based on a partial filename. Help appreciated.
I've tried to loop through files based on partial filenames but haven't found a way of doing this.