Or to save oneself two invocations of grep and the cat:
Code:
awk '/404/ && /class/' access.log > extract
Oh, and if the two patterns are always in the
same order a simpler one-grep approach would
also work, it they're not a slightly lengthier
(and uglier) solution using one grep could be found.
Code:
grep "404.*class" access.log > extract
egrep "(404.*class|class.*404)" access.log > extract
Personally I find the awk solution cleanest ... ;)
Cheers,
Tink