Find and Replace Vi

Lot of times we Will be in a situation to find and Replace some characters in a file.

say my file contains


and now i need to remove all quotes from the file , use the following substitution vi command


Explanation :

– press escape to move into command mode

1 – start range
2 – end range
s – substitution

” – the character that needs to be retraced. remember , whenever we are using a special character we need to precede it with back slash

now the file looks like


hence the general pattern Will be

:start,end s/text to find/text to replace

another simple example