Logical OR in GLOB during grep - include / exclude
In Ubuntu terminal, I would like grep
all files with extension (or excluding) .foo
and .bar
for the phrase 'foobar'
.
I read this advice for creating GLOB
with boolean or, and tried several combinations, but none of them work:
rgrep "foobar" --include "*.foo|*.bar"
rgrep "foobar" --include "*.{foo,bar}"
rgrep "foobar" --exclude "(*.foo|*.bar)"
What's the secret recipe?
+3
source to share