LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-08-2009, 12:51 AM   #1
hadimotamedi
Member
 
Registered: Aug 2009
Posts: 228

Rep: Reputation: 30
Inquiry:How to Search/Replace in vi text editor


Dear All
Can you please do me favor and let me know how to Search and Replace in vi text editor ?
Thank you in advance
Regards
H.Motamedi
 
Old 09-08-2009, 12:57 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
replace in entire file: ":%s/change this/to this/g"

for things like this, you should have a vi cheatsheet to hand. e.g. http://www.lagmonster.org/docs/vi.html
 
  


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
Inquiry:How to copy/paste in vi text editor hadimotamedi Linux - Newbie 7 08-31-2009 07:58 PM
editor search and replace yusufs Linux - General 8 03-01-2008 08:15 PM
How to replace text using VI editor ajaz_javeed Linux - Newbie 2 03-31-2007 07:40 AM
How to replace text using VI editor ajaz_javeed Programming 2 03-30-2007 08:01 AM


All times are GMT -5. The time now is 04:53 PM.

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