[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: searching inside files with find, cat and grep as a oneliner ...



On Fri, 17 Sep 2010 18:08:18 +0000, Albretch Mueller wrote:

> I need to:
> ~
>  search for files using a pattern (say all files with a certain
>  extension)
> ~
>  then search inside each of the found files for a word or regexp pattern
> ~
>  You could do this using find, cat and grep in a script, but I was
> wondering about how could you do it with a oneliner ~

How about?

***
find /path/to/search/ -type f -iname \*.ext -exec grep -H 'text to search' {} \;
***

Greetings,

-- 
Camaleón


Reply to: