Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re^2: Find all JPEG files in a directory

by gellyfish (Monsignor)
on Aug 11, 2005 at 20:39 UTC ( #483125=note: print w/ replies, xml ) Need Help??

in reply to Re: Find all JPEG files in a directory
in thread Find all JPEG files in a directory

I don't know about your find command but mine doesn't do that - I think you'll need to use grep:

find ../images | egrep '\.jpe?g$'
alternatively if just one directory level is required then you could ls - with bash you can do:
shopt -s extglob; ls ../images/*.jp?(e)g; shopt -u extglob


Comment on Re^2: Find all JPEG files in a directory
Select or Download Code
Replies are listed 'Best First'.
Re^3: Find all JPEG files in a directory
by Transient (Hermit) on Aug 11, 2005 at 20:47 UTC
    You're right on that one... this is supposed to be supported, but I can't get it to work on AIX:
    find . -name "*.jp{,e}g"

      I think you might need to use single quotes around the argument to -name lest it get expanded by the shell before it gets passed to find


        well, find . -name "*.jpg" will work just fine, so the double-quotes are ok... it's just the curly braces that are being loopy

        I just checked and AIX doesn't support {}, but Linux is supposed to (at least a cursory glance at a website said it did), although, I'm sure that varies based upon build.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://483125]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2015-11-29 05:45 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (747 votes), past polls