In the bash
command line, I want to find all files that are named foo
or bar
. I tried this:
find . -name "foo\|bar"
but that doesn't work. What's the right syntax?
In the bash
command line, I want to find all files that are named foo
or bar
. I tried this:
find . -name "foo\|bar"
but that doesn't work. What's the right syntax?
I am cheap with find, I would use this:
find ./ | grep -E 'foo|bar'
Thats just my personal pref, I like grep more than find because the syntax is easier to 'get' and once you master it there are more uses than just walking file tree.