Debian – How to Find and Rename Files Recursively by Specific Name

debian

I have a tree of folders. Some of them contain file named ".file.php"
How do i rename all the files with this name recursively in the tree to ".file1.php"?
I'm on debian server.

Best Answer

The full solution would look as follows

find -name '*.file.php' -exec rename 's/\.file\.php$/.file1.php/' {} \;
Related Question