grep – a patternmatcher
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