Solved

Search filename or word in Unix

Posted on 2010-11-28
9
391 Views
Last Modified: 2012-05-10
What is the fastest command to do a searching in Unix to find a filename or word? Please advice.
0
Comment
Question by:kaka0
[X]
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
9 Comments
 
LVL 8

Expert Comment

by:robthewolf
ID: 34225392
find, check man pages for specifics.
linux will have locate as well.
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 34225676
If you need to search for a word within a file, then you'll want to look at the grep command, or one of its brothers.

man grep
0
 
LVL 8

Expert Comment

by:robthewolf
ID: 34225746
Or of course if you wanted to find words in a selection of files you could use the pipe to combine find and grep together.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:kaka0
ID: 34230636
Could you people give me more details about your solutions?
0
 
LVL 8

Expert Comment

by:robthewolf
ID: 34230710
not unless you are more specific about what you want to look for.  Otherwise we might as well just quote the man pages at you.  
0
 
LVL 23

Accepted Solution

by:
Kamaraj Subramanian earned 350 total points
ID: 34240012

find . -type f | xargs grep "pattern"

Open in new window

0
 

Author Comment

by:kaka0
ID: 34387159
Actually, I am expecting more grep command or ??grep comand for the solution.
0
 
LVL 8

Expert Comment

by:robthewolf
ID: 34387426
you have been given an example with grep.  What are you looking for.  Can you be more specific
0
 

Author Closing Comment

by:kaka0
ID: 35070265
I would expect more details/examples/description.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

728 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