Help With Find Syntax

Drew Tomlinson drew at mykitchentable.net
Fri Oct 14 11:56:02 PDT 2005


I want to recursively search a directory and return files that end in 
".jpg" or ".gif" but I can't seem to get the find syntax right.  My 
basic command lines are:

find /multimedia/Pictures -iname "*.gif" -print

OR

find /multimedia/Pictures -iname "*.jpg" -print

Both of these work perfectly.  But I can't figure out how to combine the 
two.  'man find' tells me the the OR operator is '-or'.  Thus it seems 
that some incantation along this line would work:

$ find /multimedia/Pictures -iname "*.gif" -or "*.jpg" -print      
find: paths must precede expression
Usage: find [path...] [expression]

I've tried various placement of quotes, parenthesis, etc. but can't seem 
to find the right way to do this.  Can someone show me my error?

Thanks,

Drew

-- 
Visit The Alchemist's Warehouse
Magic Tricks, DVDs, Videos, Books, & More!

http://www.alchemistswarehouse.com



More information about the freebsd-questions mailing list