Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Vi multiple searching

Posted on 2007-11-20
1
1,095 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

860 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