replace text in a file with perl

here’s how to replace text in a file with perl:

perl -pi -e 's~OLDTEXT~NEWTEXT~g' /path/to/filename

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.