Notes:
- there are THREE places to put your text. You have to tell grep what to find and then sed what to find and replace.
- The grep find string doesn't have to exactly match the sed find string. That's your business.
- Don't forget to put a backslash "\" (escape code) before any character you think or know is "special". If the command doesn't work for you, check this first and second and third. For example, periods, apostrophes, and quotation marks (double quotes) are "special": s/3\.1416\"/3\.1416\'/
grep -rl 'what_to_find' ./ | xargs sed -i 's/what_to_find/what_to_replace_with/g'
No comments:
Post a Comment
Spammers, don't waste your time. If you need honorable work, let's brainstorm. Do you see any spam comments here? No. That's because you won't get through. I personally review every comment.
Real folks, thanks for commenting!