I'm looking for a linux command to search a folder directory and it's subfolders for a file by name and replace all of them with a copy of another file. Any idea?
Assuming you have the replacement file in your home directory (~), you can use find to do the replacing. This will find all boom.txt files and replace them with the replace.txt file (keeping the boom.txt name).
find . -name "boom.txt" -exec cp ~/replace.txt {} \;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With