Breaking News
Home / Sys Admin / Unix / How perform global search and replace in vi?

How perform global search and replace in vi?

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.

[pb_builder]

Check Also

How to list disks information in Linux?

In order to check the disk in the system we can use the List Hardware …

Leave a Reply