Linux replace all instances of a file
Posted on 2013-11-06
How would you go about overwriting every instance of a file on a server, while maintaining owner and permissions?
For example: Say I have a file named --> file1.php
I want to overwrite every copy on my server of file1.php with my new copy. However, since I am using WHM/cPanel... Those files will all be under different user accounts. So I want to still maintain the same owners, and file permissions of the original file.
Any ideas? Assume it would have to be a shell script that retrieved the permissions of a file before it overwrote it?