Search and Replace in VI


In Unix file, we will be able to search the particular keyword and replace it with different keyword globally.


->  :%s/search keyword/replacement keyword/g

In the above example the keyword Selvarasu will be replaced with Pachamuthu in the file. The keyword “g” used to search and replace globally. That means it will replace the keyword all over the file.


Like it? Please Spread the word!