how to replace in bash script using grep code example Example: grep find and replace grep -rl 'oldString' ./ | xargs sed -i 's/oldString/newString/g'