Tags

, , , ,

$ perl -pi -w -e 's/foo/bar/g;' *.txt

-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop

It will search for “foo” in files with extension .txt and replace it with “bar”.

Credit: here.

Advertisements