?
Solved

Search filename or word in Unix

Posted on 2010-11-28
9
Medium Priority
?
395 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
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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

850 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