Bulk Edit Files
-
I have a website built 100% out of htm files.
We have moved the site from domain1.com to domain2.com but some links are still pointing to domain1.com.
What command can I use in linux to search all the files, and find/replace.
Seems like a easy command for @scottalanmiller
There all in one directory, but there is sub directory's. Want to look at all files and sub directory's.
Aaron
-
@aaronstuder said:
I have a website built 100% out of htm files.
We have moved the site from domain1.com to domain2.com but some links are still pointing to domain1.com.
What command can I use in linux to search all the files, and find/replace.
Seems like a easy command for @scottalanmiller
There all in one directory, but there is sub directory's. Want to look at all files and sub directory's.
Aaron
Search all the files is find, to do the replacing in them is sed
-
So you would use find and -exec into sed.
-
A very detailed answer with examples can be found over on unix.stackexchange: How can I replace a string in a file(s)?