INSTALLATION DOCUMENTS BY RAVI

Thursday, May 11, 2017

sed command to search replace a word in a file in linux

Command to search and replace a word in a file:

sed -i 's/original word/word to replace/g' filename

Command to search and replace a word in all of the files in a directory:


grep -rl 'original word' path_of_the_directory | xargs sed -i 's/original word/word to replace/g'

No comments:

Post a Comment

  Opatch reports 'Cyclic Dependency Detected' error when patching ODI   Issue: When applying a Patch Set Update (PSU) to WebLogic Se...