LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to build regex for find command with OR (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-build-regex-for-find-command-with-or-4175479928/)

jim.thornton 10-07-2013 01:21 PM

How to build regex for find command with OR
 
I would like to run one find command and find all files with .pdf or .doc file. I can get it to return them individually but I can't do it in one command. Can someone help me please?

Here is what I have:
Code:

$ find . -iregex ".*\.pdf"
$ find . -iregex ".*\.doc"

Both those commands work but how do I get them into one, and add others (e.g. .txt, .chm, etc)?

Firerat 10-07-2013 01:29 PM

add an -o

Code:

find . -iregex ".*\.pdf" -o -iregex ".*\.doc"
man find

for details


All times are GMT -5. The time now is 03:05 AM.