I have thousands of HTML pages that need to be updated – I just have to swap a couple of lines. I was wondering how to do it all at once and in subdirectories as well.
Here’s what worked:
for mFile in `find . ! -type d -name ‘*.html’` do
sed -i ‘s/text1/replacement1/g’ $mFile
sed -i ‘s/text2/replacement2/g’ $mFile
sed -i ‘s/text3/replacement3/g’ $mFile