Linux Script to Delete and/or Rename Files
We have a problem at work that we are using Word Press And now for security we have to delete install.php in WP-Admin and rename upgrade.php and install_helper.php to *.bak
Im a noob in Script creating (Had a bit practice a couple of years ago but allready forgot T.T) So what i ask that is there a way to make a script That: Finds wp-admin(if it exists) folder enters into it and there deletes install.php and renames upgrade.php and install_helper.php to *.bak and the makes the same process again untill theres no wp-admin folders left with these files, We have alot of web pages so manually it would take about a month to find em all (about 3000 pages :/) Thank you, |
Code:
find . -type f -wholename '.*wp-admin/install.php' -delete Code:
find . -type f -wholename '.*wp-admin/install.php' -delete |
Thanks alot, im useless at Linux script creating so u saved my life :)
btw i use it with #!/bin/bash or something else? And what would be the command to delete whole folder? and to change permissions? find . -type f -wholename '.*wordpress/wp_config.php' -exec chmod {} 644\; Thank you |
Quote:
Quote:
to delete wordpress folders for example Code:
find . -type d -name 'wordpress' -exec rm -f {} \; Quote:
Code:
find . -type f -wholename '.*wordpress/wp_config.php' -exec chmod 644 {} \; |
Thank you very much u helped me alot
|
Great to see you have an answer, but please mark as SOLVED so we all know that is the case :)
|
All times are GMT -5. The time now is 02:35 AM. |