how to replace a string in vi

first occurrence on current line:

:s/SEARCHTERM/REPLACEWITHTERM

globally/all occurrences on current line – note the /g at the end, this makes it “global”

:s/SEARCHTERM/REPLACEWITHTERM/g

every occurrence in file:

:%s/SEARCHTERM/REPLACEWITHTERM/g
Previous
Previous

relaunch finder on your mac

Next
Next

oracle peoplesoft installation – running the data mover from unix