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 ...
- 09-21-2009 #1Just 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!
- 09-21-2009 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
Google: find multiple files linuxCode:find / -iname "*.php" -o -iname "*.htm" -o -iname "*.html"
- 09-21-2009 #3Just 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!
- 09-22-2009 #4Linux Newbie
- Join Date
- Jul 2008
- Posts
- 181
-iname uses globs, not regexps. If you want to use regexps:
HTML Code:-iregex ".*\(html\|php\)"


Reply With Quote