How to look for a file with a specific expression in UNIX recursively?

Hi,
How can I find the list of files that includes a specific expression?

Let's say I am in /opt and I want to find the files that include "insert Ahd"

Thanks,
TolgarAsked:
Who is Participating?
 
Bryan ButlerConnect With a Mentor Commented:
The -r makes it recurse through sub-folders.
The -l makes it print the filenames and not the lines.

grep -lr "insert Ahd" *
0
 
woolmilkporcConnect With a Mentor Commented:

grep -r "insert Ahd" /opt

wmp
0
 
Kent OlsenConnect With a Mentor Data Warehouse Architect / DBACommented:

Easy enough.  :)

  grep -l  "insert Ahd"  *



Kent
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.