grep -rl matchstring somedir/ | xargs sed -i ’s/string1/string2/g’
Ok so yeah. This uses grep to find a string in files in a directory and then executes sed to change a string in all of them. A beautiful super simple command…thx vasir!
grep -rl matchstring somedir/ | xargs sed -i ’s/string1/string2/g’
Ok so yeah. This uses grep to find a string in files in a directory and then executes sed to change a string in all of them. A beautiful super simple command…thx vasir!