[nSLUG] Find and replace command

Oliver Doepner odoepner at gmail.com
Thu Oct 2 22:36:07 ADT 2014

Assuming you have only one opening body tag in your html files and you want
to get rid of all the body tag attributes and your html files all have
.html extension :

find -iname '*.html' -print -exec sed -i 's/<body[^>]*>/<body>/' {} \;

The -print is so that you see the paths of the files being processed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20141002/4328475d/attachment-0001.html>

More information about the nSLUG mailing list