Solved

Search filename or word in Unix

Posted on 2010-11-28
9
388 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
 

Author Comment

by:kaka0
ID: 34230636
Could you people give me more details about your solutions?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
perl search and replace 6 165
PERL get the value for query 4 145
perl to convert excel to csv 3 181
batch script for automated email 12 100
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…
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…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

932 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

6 Experts available now in Live!

Get 1:1 Help Now