Monday, November 21, 2011

More about sed search and replace

Apparently with sed, it doesn't need the % in front of s as with vi to search and replace throughout the whole file.

Here is a very nice link with some hints, in particular:

$ find /home/bruno/old-friends -type f -exec sed -i 's/ugly/beautiful/g' {} \;

http://www.brunolinux.com/02-The_Terminal/Find_and%20Replace_with_Sed.html