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

Perfect order of ODI export and import

  Smart Export / Import is the recommended way to achieve such a migration. This is the easiest way to make sure all the dependencies are ta...