I figured out what was wrong. I needed to add '' after the -i and before the 's/../../':
grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewith/g'
I figured out what was wrong. I needed to add '' after the -i and before the 's/../../':
grep -l \'texttofind\' * | xargs sed -i '' 's/toreplace/replacewith/g'