Warning: Trying to access array offset on value of type bool in /data/www/freeminded.org/www/wp-content/plugins/wp-latex/wp-latex.php on line 39 grep – a patternmatcher @ Freeminded.org Warning: Trying to access array offset on value of type bool in /data/www/freeminded.org/www/wp-content/plugins/wp-latex/wp-latex.php on line 46

grep – a patternmatcher

This entry was posted by on Wednesday, 5 May, 2010 at

Article on the usefulness of grep.

Say you have a heap of files, and want to search for the occurence of ‘foo’ and ‘bar’ on the same line:

grep -Hrin foo * | grep -Hrin bar *

This will output (if found):

some_file:6: blah blah foo blah blah bar blah blah


Leave a Reply