In the Ubuntu terminal, I would like to grep
all files with (or excluding) extension .foo
and .bar
for the phrase 'foobar'
.
I've read this advice for creating a GLOB
with a logical or, and tried a few combinations but none seem to work:
rgrep "foobar" --include "*.foo|*.bar"
rgrep "foobar" --include "*.{foo,bar}"
rgrep "foobar" --exclude "(*.foo|*.bar)"
What's the secret recipe?