What is the best way to rename text in different files? Need to rename all text who is ex: static.website.com to static.newwebsite.com
The text in named in css,php and html files who is on one folder. Im using Putty to see and change files. The folder is on Ubuntu
If you have a terminal open on the Ubuntu machine, change to the directory where the files are (since you said they are all in the same directory) then use the following to replace all instances of static.website.com
with static.newwebsite.com
sed -i'.bak' 's/static.website.com/static.newwebsite.com/g' ./*.{css,html,php}
-i'.bak'
: -i
means to edit in place and '.bak'
will create a backup of the original with the extension .bak