LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to replace text using VI editor (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-replace-text-using-vi-editor-541864/)

ajaz_javeed 03-30-2007 05:22 AM

How to replace text using VI editor
 
Hello everybody,

I want to replace text using VI and I know to replace a single word like :

:%s/oracle/prod/g

This will replace the word oracle with prod.

Now, I am trying to replace /oracle/oracle with /Courseware/ora9i.

How could I achieve this ?

Thanks and Regards
AJAZ

pwc101 03-30-2007 05:26 AM

Code:

:%s/\/oracle\/oracle/\/Courseware\/ora9i/g
You have to escape the forward slashes (/) with backslashes (\).

Junior Hacker 03-31-2007 06:40 AM

You can also learn to use vim by typing "vim tutor" in a terminal to take a 20-30 minute crash course.


All times are GMT -5. The time now is 05:50 PM.