Answer the question
In order to leave comments, you need to log in
How to write a bash script to search and copy files?
Greetings!
There is a file filename123.txt, I need to search 500 directories for filename123.exe, and if such a file exists, then copy it to filename123.txt
, now let's say I have a directory in which:
filename123.txt.
filenameAD.txt
...
1filename.txt
B I need to do such a search for each. Can you give me some hints on how to do this?
Answer the question
In order to leave comments, you need to log in
I'm assuming that since you're asking this question, you're not familiar enough with the capabilities of the find command. I offer you not just a help for this command, but a whole service , for those who have not yet memorized the parameters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question