Replace text inside a file

February 27, 2004

To replace all occurances of “shtml” with “php” inside of all of the *.php files in a directory.
$ perl -pi.bak -e 's/shtml/php/' *.php
See: hacks.oreilly.com: Global Search and Replace with Perl for more examples.

Transform your business without wasting money.

We help you identify, audit and implement technology changes within your business to create leverage points to scale your company faster.