multipe search criteria in vi

I have a vi editor

Q1 I need to search text in a large file for multiple criteria like

date should be 03/23/2011 and text should be abc

:? 03/23/2011 abc

Q2. I want to search for last occurance of word abc in the vi editor
gram77Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
farzanjConnect With a Mentor Commented:
Q1:
In the command mode:
Enter the following
:/\03\/23\/2011 abc


Q2:
In the command mode
G
:?abc
0
 
gram77Author Commented:
/\03\/23\/2011 abc does not work
0
 
farzanjConnect With a Mentor Commented:
I am sorry, I mistyped it

/03\/23\/2011 abc

If that doesn't work

Try
/03\/23\/2011.*abc

Also try
/03.23.2011.*abc


All of the above should work
0
 
farzanjCommented:
For question 1:
If you are at the top of the file  (if not you can do 'gg'), or at the bottom of the file (or you can go to the bottom by pressing G)you can do

:?abc
0
 
gram77Author Commented:
excellent
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.