I have a large directory tree structure with text files (php, html, etc). I need to search for a string that occurs frequently throughout these files and flip the \
to a /
. I need this to recursively traverse the entire structure. I've seen a couple of suggestions about how to do this, but I'm not able to get them to work for me.
Search for: \MySite\scripts\connection.php
Replace with: /MySite/scripts/connection.php
I tried this, but it didn't work:
find ~/Desktop/administration/ -type f -exec grep -l '\MySite\scripts\connection\\' {} \; -exec sed -i 's#\MySite#\scripts#\connection.php\#/MySite#/scripts#/connection/#g' {} \;