I'm trying to exclude all hidden directories from recursive search.
I think .*/\..*
this should match hidden directories and this indeed works with find, however grep doesn't think so.
pcregrep -rnI -C 5 --exclude-dir='.*/\..*' '^\s*async def' .
grep -rnIP -C 5 --exclude-dir=*/.* '^\s*def' .
What am I doing wrong here?
Oh, and I know about ripgrep, silver searcher etc. The question is about grep and pcregrep.
.*
which would exclude current directory which starts with.
and wouldn't find anything. – user1685095 Mar 02 '17 at 09:03