How to Change Text Inside Multiple Files in Unix

Written by Amit Agarwal on Aug 12, 2007

I recently moved my feed from to and so had to change the <link> tag inside all HTML documents to reflect the change.

One of the options was to do a vi *.html and replace text manually but here’s a simple solution:

sed -e 's/old-address/new-address/' -i *.html

If you want to replace text in just a couple of files, replace with the wildcard character with the name of the files.

Subscribe to our Email Newsletter