Both vi and vim text editor comes with almost same command for finding and replacing text.
Syntax:-
:%s/FindWord/ReplaceWith/g
Find and Replace with Confirmation :-
Syntax:-
This Command find a word called ‘FindWord’ and replace with ‘ReplaceWord’, but ask for confirmation first, enter:
:%s/FindWord/ReplaceWith/gc
0 comments:
Post a Comment