I ran across a text manipulation utility which I use in dos and which has also a linux version. It is powerful, fast, and easy to use. It will do the find and replace task you want from the cli, and much more. I haven't tried the linux version, so I'm hoping someone does try it and report how it works. at: http://www.pagesz.net/~minitrue