Da quel che ho visto la struttura di prova dovrebbe essere così:
Codice: Seleziona tutto
8-) tree -Fa test
test
├── .dot-dir/
│ └── nome
└── nome
1 directory, 2 files
8-)
mi sposto in .dot-dir
Codice: Seleziona tutto
8-) cd test/.dot-dir/
8-) ls -a
. .. nome
8-) cat ../.dot-dir/nome
fabio no
8-) cat ../nome
fabio ok
Dire che il manuale sia chiaro, sarebbe una bugia.
io trovo:
--exclude=GLOB
Skip files whose base name matches GLOB (using wildcard
matching). A file-name glob can use *, ?, and [...] as
wildcards, and \ to quote a wildcard or backslash character
literally.
--exclude-from=FILE
Skip files whose base name matches any of the file-name globs
read from FILE (using wildcard matching as described under
--exclude).
--exclude-dir=DIR
Exclude directories matching the pattern DIR from recursive
searches.
questo pattern DIR è interpretabile come regex o come glob?
A forza di prove ho visto che il modo corretto per ottenere i risultati giusti è indicare l'argomento, con le directory in cui cercare, usando il globbing.
Codice: Seleziona tutto
8-) cd ..
8-) grep -r --exclude-dir=".*" 'fabio' ../test/*
fabio ok
8-) grep -r --exclude-dir=".*" 'fabio' ./*
fabio ok
8-) grep -lr --exclude-dir=".*" 'fabio' ./*
./nome
Confermi?
Probabilmente è meglio usare '--exclude', ma non ho fatto prove.