ersin.fr
msgbartop
just my personal notebook…
msgbarbottom


12 Aug 15 Replace a String in Multiple Files in Linux Using Grep and Sed

Advertisements
Example
grep -rl 'old-string' ./ | xargs sed -i 's/old-string/new-string/g'

This will search for the string ‘old-string’ in all files relative to the current directory and replace ‘old-string’ with ‘new-string’ for each occurrence of the string in each file.