• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

Search filename or word in Unix

What is the fastest command to do a searching in Unix to find a filename or word? Please advice.
0
kaka0
Asked:
kaka0
1 Solution
 
robthewolfCommented:
find, check man pages for specifics.
linux will have locate as well.
0
 
FishMongerCommented:
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
 
robthewolfCommented:
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
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
kaka0Author Commented:
Could you people give me more details about your solutions?
0
 
robthewolfCommented:
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
 
Kamaraj SubramanianApplication Support AnalystCommented:

find . -type f | xargs grep "pattern"

Open in new window

0
 
kaka0Author Commented:
Actually, I am expecting more grep command or ??grep comand for the solution.
0
 
robthewolfCommented:
you have been given an example with grep.  What are you looking for.  Can you be more specific
0
 
kaka0Author Commented:
I would expect more details/examples/description.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now