0

I'm running this command to find all the files named deploy.php in my whole project and make a copy of them and place them in the same directory as they were found, with name deploy_bkp.php

find . -type f -name "deploy.php" -exec cp {} deploy_bkp.php \; 

But it's not working recursively, it's only working for files on the top directory.

0

1 Answer 1

1

According to https://askubuntu.com/questions/497122/find-and-exec-in-found-folder you should use -execdir
Your command should look like this:

find . -type f -name "deploy.php" -execdir cp {} deploy_bkp.php \; 
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.