Search for a file using content criteria

I have a newbie question. How do you search for a file(s) using their contents as the criteria?
DBDevOneAsked:
Who is Participating?
 
ddunleaConnect With a Mentor Commented:
Use -r for recursive so specifying

grep "text" -r *

Will search all of the files starting in the current directory and working down.
0
 
ddunleaCommented:
man grep

specifically,

grep "string to search for" files_to_search
0
 
DBDevOneAuthor Commented:
Thank you what if you don't know the file name though? Do you just put a wildcard on the end? Do you need to be in the directory of the file when you run this command or does it search everywhere
0
 
DBDevOneAuthor Commented:
Nice job mister!!! Thank you.
0
 
ddunleaCommented:
No problem.
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.

All Courses

From novice to tech pro — start learning today.