UNIX "find" command, match literal "dot"
- by Robottinosino
I need files ending with ".pdf" or ".png"; here's my attempt:
find /Users/robottinosino/Desktop/_PublishMe_ -type f -regex '.*[pdf|png]'
this incorrectly includes files ending with "Apdf", "Zpdf", etc. (missing literal dot before file extension)
I tried adjusting the pattern to:
find /Users/robottinosino/Desktop/_PublishMe_ -type f -regex '.*\.[pdf|png]'
but then no results are returned. Escaping the . with a backslash does not work. Why?
[0] $ uname -a
Darwin Robottinosino.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
Thanks!