On Tue, 25 Jul 2006, Alex Esplin wrote:
> On 7/24/06, Jeff Schroeder <[EMAIL PROTECTED]> wrote:
> > ls R_{ALL,01}*
> 
> Do the { } work for the `find` command also?

The man page says "no", but you can always use -o to "or" multiple -name 
options together:

 find . \( -name 'R_ALL*' -o -name 'R_01*' \) -print

Yes, it's a bit cumbersome.  And yes, the parens are required.  If you 
leave out those parens, the foregoing find command will print only those 
files which match the final pattern.  If you don't like the parens, this 
will work, too, though even more cumbersomely:

 find . -name 'R_ALL*' -print -o -name 'R_01*' -print

The above differs slightly from the naive grep equivalent because -name 
only matches file basenames.  Unless you construct your pattern 
specifically to avoid it, a simple grep will match anything in the full 
pathnames.

Chris

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to