search and find

Good Morning Team,

Looking for some help on shell scripting please

I need to search recursivly through a tree of directorys for a file I will input and text I am looking for, so the input would look like this:

./search.sh /var/www iframe

And display the path and file name if found..

Can anyone give any ideas please..

All the best from Alan

Why don't you use the find command? Have a read the man page for the options.

Regards

Hi there,

Yes I did use find command but it needs a combintation of find and grep through about 100,000 files.
And that is where I get stuck

All the best from Alan

use find command. the simplest syntax iss

find . -name "*.*"

if you want to find the text inside the files

find . -name "*.*" | xargs grep -i "txt to search for"

change "." to any base directory you want to start search. replace "*.*" to any specific patter to search for pattern.

find /var/www -name iframe -print

Whats the probelem? Performance?

Thank you very much that worked perfect saved a lot of time and trouble, and thanks to everyone else for there suggestions

Best regards from Alan