Solved

Search filename or word in Unix

Posted on 2010-11-28
9
387 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
Comment Utility
find, check man pages for specifics.
linux will have locate as well.
0
 
LVL 28

Expert Comment

by:FishMonger
Comment Utility
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
Comment Utility
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
Comment Utility
Could you people give me more details about your solutions?
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 8

Expert Comment

by:robthewolf
Comment Utility
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
Comment Utility

find . -type f | xargs grep "pattern"

Open in new window

0
 

Author Comment

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

Expert Comment

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

Author Closing Comment

by:kaka0
Comment Utility
I would expect more details/examples/description.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

11 Experts available now in Live!

Get 1:1 Help Now