find multiple paths

How do i find files in more than one directory? I searched through forums, but could not land into the right thread.

I tried something like

find dir1|dir2 -name file1

but it doesn't work. Please suggest.

DIRLIST="dir1 dir2 dir3 dir4"
for DIR in ${DIRLIST}; do
   find ${DIR} ...
done

Thanks. But, is it not possible to use a single find command to look in multiple directories?

Just tried on gnu find:

find dir1 dir2 dir3 -type f ....

and it worked.

Works on AIX's find too.

Yes, it works for me too in AIX :b:

Didn't guess it would be so simple :slight_smile:

Lol nor did I. I haven't used find this way until yet^^