oweifa
Last Updated: February 25, 2016
·
139
· buithehoa
Avatar fb

Replace a String in Multiple Files Using grep and sed

grep -rl 'matching_string' some_directory/ | xargs sed -i 's/matching_string/new_string/g'

Sample:

$ grep -rl 'fileItems' app/assets/javascript/ | xargs sed -i 's/fileItems/fileItemList/g'
Say Thanks
Respond
Filed Under