Posted by alex in Insights at 11:45 PM
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:
editor,
replace,
string,
vi
This entry was posted on Friday, October 10th, 2008 at 11:45 PM and is filed under Insights. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.