Try:
Code:
$ grep -Rl foo ./ | grep -v "CVS/" >> log.txt
l (thats 'ell') just means list the files that match, the second grep then removes anything with CVS in the path or filename but the / means that it should only match paths
grep has a --exclude option but it seems only to work on the filename not the path.
Shady