Solved

Vi multiple searching

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

914 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

17 Experts available now in Live!

Get 1:1 Help Now