I'm using this command to go through all files, directories and subdirectories to change any mentions of oldurl.com
to newurl.org
:
find . -type f -name '*.php' -exec sed -i 's|oldurl.com|newurl.org|g' {} +
It works fine, however, I need to exclude three sub-directories from ANY CHANGES: /cache
, /archive
and /etc
as changing the urls with the above command in these paths breaks other scripts.
Haven't had much luck finding an answer... Is it even possible?
Many thanks for any suggestions/help.