Posted By

sanjivarunsahayamhotmailcom on 10/29/08


Tagged

Bash linux find exec


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

sulfurito


Search a list of files for some text


 / Published in: Bash
 

Searches for some text in a list of files. Displays the results with the filename where the snippet was found.

  1. find -name your_file_matcher -exec grep 'text_to_match' -H {} \;
  2.  
  3. eg.
  4.  
  5. find -name *.pom -exec grep 'apache' -H {} \;

Report this snippet  

You need to login to post a comment.