LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-16-2004, 04:28 AM   #1
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Rep: Reputation: 30
search in vi editor


suppose i have to search something text in a vi editor

i pressed
/
and typed the text i want to search.

but what if my search text appears more than once in the file. how can i see that


How can i search text in vi editor if it appears more than once in a file


how to find 2nd matched text in vi editor


question can be explained more , if needed
 
Old 09-16-2004, 04:37 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,220
Blog Entries: 1

Rep: Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074Reputation: 2074
Press again / and <enter>.
 
Old 09-16-2004, 04:38 AM   #3
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Original Poster
Rep: Reputation: 30
thanks

thanks
 
Old 09-16-2004, 05:06 AM   #4
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
Or simply type n while in command mode.
BTW, to go backward, type ?<enter>.

Yves
 
Old 09-16-2004, 06:43 AM   #5
emailssent
Member
 
Registered: Sep 2004
Posts: 312

Original Poster
Rep: Reputation: 30
thanks theYinYeti
 
Old 09-16-2004, 08:14 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,426

Rep: Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786
Also, (at least with vim on RH9) once you type in the '/' char, you can then use the up-arrow key to select a previously used search pattern (and down arrow to go back down through the list).
The same with the '?' char.
 
  


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
search default: search post title only slackie1000 LQ Suggestions & Feedback 4 03-10-2005 08:50 AM
remove color after word search in vi editor dylan912 Linux - Newbie 1 12-10-2004 05:15 AM
Quick VIM question (unhighlighting search terms after search) lrt2003 Linux - Newbie 5 05-08-2004 06:21 PM
Java: Getting the contents of a search dialog box in text editor i am making ludeKing Programming 4 04-23-2004 09:46 PM
How to 'apt-cache search' & 'apt-file search' by distribution? davidas Debian 3 04-19-2004 02:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 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
Open Source Consulting | Domain Registration