Quantcast
Channel: Developer Feed - Unix
Viewing all articles
Browse latest Browse all 10

How perform global search and replace in vi?

$
0
0

Solution

Use the following command for global search & replace in the file:

:%s/search_string/replacement_string/g

This command tells vi to scan all lines in the file for search_string and change it to replacement_string throughout the file in one short.


Viewing all articles
Browse latest Browse all 10

Trending Articles