?
Solved

Search filename or word in Unix

Posted on 2010-11-28
9
Medium Priority
?
393 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 1050 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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
Suggested Courses

743 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