LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-30-2007, 06:22 AM   #1
ajaz_javeed
LQ Newbie
 
Registered: Jan 2007
Posts: 24

Rep: Reputation: 15
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
 
Old 03-30-2007, 06:26 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Code:
:%s/\/oracle\/oracle/\/Courseware\/ora9i/g
You have to escape the forward slashes (/) with backslashes (\).
 
Old 03-31-2007, 07:40 AM   #3
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Editor on Fedora Core 4 in Text Mode blong4life Linux - Software 5 07-31-2006 10:07 PM
Which light text editor can copy text from file and paste in browser? davidas Linux - Software 9 03-06-2006 12:28 PM
Replace text of unknown content with other text in file brian0918 Programming 15 07-14-2005 10:22 PM
Replace text of unknown content with other text in file brian0918 Linux - Software 1 07-14-2005 04:22 PM
How to 'Find and Replace' text in vi editor? concoran Programming 2 11-21-2001 10:40 AM


All times are GMT -5. The time now is 01:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration