grep -l \\\'texttofind\\\' * | xargs sed -i \'s/toreplace/replacewith/g\'
Im getting this error when I run the above command in the terminal.
I figured out what was wrong. I needed to add '' after the -i and before the 's/../../':
''
-i
's/../../'
grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewith/g'