I have thousands of text files called file.txt. Because they all share the same name I cannot move them to the same folder without them overwriting.
I need a command that will locate all of the file.txt files that are within thousands of directories and subdirectories, append the full path name to the end of the file name and then copied to a specified folder leaving the original where it was.
from: file.txt to: a/123/file.txt
(i know / cant be used in a file name so hyphens or underscores will work, unless there is a visually more appropriate replacement)
Also, the command would need to ignore case as some are file.txt and some are File.txt as well have an optional 'S' on the end (file.txt or files.txt).
During the renaming, I am hoping the path can be appended as is, without changing case as the directory/subdirectory names are randomized (example: a/adgDGeRddsdvvsdGSD/[fF]ile[s].txt