Solved

Vi multiple searching

Posted on 2007-11-20
1
1,090 Views
Last Modified: 2013-12-16
I used to vi editor as standard used. But I dont know how to do multiple searching....normally I able to search single words during vi.

for example:
1) vi filename.txt ( opening the file )
2) /wordthatiseek ( in vi editor i type this to search the words)

let say the /var/log/message file. i want to search line with date and some message
 example:
i want to search 20112007 and words 'failed'. what should i type after the '/'?

thanks
0
Comment
Question by:operation1612
1 Comment
 
LVL 2

Accepted Solution

by:
terrydavis earned 50 total points
ID: 20320199
Searching in vi is line based and you can use regular expressions.   So if you are looking for lines that contain both 20112007 and failed (in that order), try this:

:/.*20112007.*failed.*

Thanks,
Terry
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now