I have a folder structure
conf/
widget1/
env1.cfg
env2.cfg
widget2/
env1.cfg
env2.cfg
widget3/
env1.cfg
env2.cfg
widget4/
env1.cfg
env2.cfg
...
What I want to do is find all the files named env2.cfg
, and create a copy of them in their directory named env3.cfg
.
I've tried:
find -name env2.cfg -exec cp '{}' "env3.cfg" ";"
but that just created env3.cfg
in the conf/
directory.
Any thoughts?
For clarification I'm doing this on Mac OSX, but ideally the same command should work on CentOS if possible.