Search and Replace in VI

To Search and Replace in VI.

:%s/search_string/replacement_string/g

% is equal to all lines in a file
g is equal to global. Replace all occurrence of the search result.

Leave a Reply