grep -rl "ToMatch" <folder>
You then want to replace that string with another string
grep -rl "ToMatch" | xargs sed -i s/ToMatch/Replaced/g
The xargs command passes the values from "grep -rl "ToMatch" <folder>" to the sed command as arguments
For more info on how to use xargs look at http://unixhelp.ed.ac.uk/CGI/man-cgi?xargs
No comments:
Post a Comment