To locate and replace a string of text in a file using use the below text.

shell# vi filename

Once in vi use the following:

:%s/string/new-string/ <enter>

That will replace any instance of string with new-string.

Tags: , , ,
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*