Find & Replace Text in Multiple Documents from the Command Line (MAC) The basic command syntax is as follows: perl -pi -w -e ‘s/THIS/THAT/g;’ /path/to/files*.txt Read the post here. Tweet Related