tags:

views:

59

answers:

2

Hi There

In Solaris, what is the syntax of find command to find files having multiple file name formats?

Eg: In my current directory and in its sub-directories if I have files like test.log, sample.out, demo.buf and some other files, how can I write single find command to find these 3 files.

Thank you Chaitanya

+1  A: 

Same as all other Unixes:

 find . -name test.log -o -name sample.out -o name demo.buf
alanc
file name must be enclosed with apostrophes!!!
Vanya
Vanya - No they don't. If they don't contain special characters--spaces, wildcards, etc.--they don't need to be quoted.
Kenster
+2  A: 

this is the correct one

find . \( -name "test.log" -o -name "sample.out" -o -name "demo.buf" \) -print