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

Loading xml file data to oracle table using python

Sample xml file (test.xml): <?xml version="1.0"?> <data>     <customer name="Ravi" >     ...