Find and replace with perl

Last modified on July 24, 2026 • 1 min read • 39 words
To replace the string jeltsch.blogspot.com by the string mnm.no-ip.com/blog you can use perl:perl -pi.bak -e ’s|jeltsch.blogspot.com|mnm.no-ip.com/blog|g’ .html If you want to do a recursive replacement on a directory tree you can try:perl -pi.bak -e ’s|jeltsch.blogspot.com|mnm.no-ip.com/blog|g’ find jeltsch.org -name ‘.html’
To replace the string jeltsch.blogspot.com by the string mnm.no-ip.com/blog you can use perl:perl -pi.bak -e 's|jeltsch.blogspot.com|mnm.no-ip.com\/blog|g' *.html If you want to do a recursive replacement on a directory tree you can try:perl -pi.bak -e 's|jeltsch.blogspot.com|mnm.no-ip.com\/blog|g' find jeltsch.org -name ‘*.html’``