Search and Replace on command-line for several files

Here is a little helper which can be used to search and replace Words in several files at one time.
For this we use perl on the command-line.
perl -p -i.bak -e "~s|search|replace|" file1.txt file2.txt file3.txt
The system will add a .bak file for each file so you have the old stuff too.

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.