Global search and replace with sed and find

sed -e 's/old1/new1/g
s/old3/new3/g' –i $(find / -name '*.php' -o -name '*.include' -o -name '*.inc' -o -name '*.class' -o -name 'ht.access')

‘locate’ would be an alternative to ‘find’.

July 12, 2012

  • Nice One Andrew. Glad to see you’re still keeping busy. Been a while since the SP days in Cathcart.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *