Sunday, January 06, 2013

Linux command to replace string in all files in directory

    grep -rl 'string1' * | xargs sed -ie 's/string1/string2/g'

Change string1 to string you want to replace.
Change string2 to replace string. 

No comments: