command line find/replace help

Posted by Chrisbloom7 on Super User See other posts from Super User or by Chrisbloom7
Published on 2011-01-10T17:26:43Z Indexed on 2011/01/10 17:55 UTC
Read the original article Hit count: 257

I've got a set of 5000+ files that I need to do a simple search and replace in. I have been doing it in a text editor (EditPlus) by opening 500 files at a time, doing a global search/replace, saving all, closing, etc. But, that's taking literally hours to do and it's boring and tedious and I already have done it once today and need to do it again because all the files got refreshed. Is there a way to do this via the Bash command line? Here's the details:

Find onchange="document.location ='/products/view.html/view/'+this.value"

Replace it with onchange="alert('Not implemented')" style="display: none"

All of the files have a .HTM extension, but they are nested in several sub directories.

© Super User or respective owner

Related posts about command-line

Related posts about shell