Find the answer to your Linux question:
Results 1 to 4 of 4
This should be easy - but how would you find any files that are ending in a possibility of 3 different ways: I have to use the find command to ...
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    3

    find by file extension

    This should be easy - but how would you find any files that are ending in a possibility of 3 different ways:

    I have to use the find command to do it.

    either php, html, or htm

    so like this:

    find /path/ -iname "*.php|*.htm|*.html"

    Of course the above doesnt work but its what I am trying to get it to do!

    Thanks!

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Code:
    find / -iname "*.php" -o -iname "*.htm" -o -iname "*.html"
    Google: find multiple files linux

  3. #3
    Just Joined!
    Join Date
    Sep 2009
    Posts
    3
    Oh wow - easier than I thought. I was trying to figure out regex for it :P

    Thank you!

  4. #4
    Linux Newbie
    Join Date
    Jul 2008
    Posts
    181
    -iname uses globs, not regexps. If you want to use regexps:

    HTML Code:
    -iregex ".*\(html\|php\)"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...