Last Updated: February 25, 2016
·
1.093K
· dakdad

Perl : Search and Replace text from a file

Very useful in command line, specially when you have a big file to go through.

perl -pi.bak -e "s/text to find/text to replace/g" *.txt

UPDATE: thanks telemachus for the correction!

1 Response
Add your response

@telemachus Thanks for the informative comment! I have updated the post.

over 1 year ago ·