perl replace text in multiple files

perl replace text in multiple files

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

Alternative (to avoid escaping slashes):

perl -pi -e 's|w/|with|g'

1 comment to perl replace text in multiple files

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>