[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 14:08:18 -0400 (EDT), 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

Search all files under the home directory (recursively) with an extension of .txt
for the keyword "xorg":

grep -r xorg ~/*.txt

  .''`.     Stephen Powell    
 : :'  :
 `. `'`

Reply to: