Reputation: 1554
I want to replace a phrase composed of two words separated with a space with another two words:
find . -type f -exec sed 's/w1 w2/w3 w4/g' {} +
However, even if the pattern 'w1 w2' occurs in many files on the current dir, nothing seems to change.
Upvotes: 0
Views: 169
Reputation: 12296
Try specifying the -i
or --in-place
option for sed. Otherwise it won't actually change the file. Check the sed documentation for more info.
Side note: you'll find it easier to troubleshoot if you first get this working without find
. Start small, then build up.
Upvotes: 1