Find files not matching a particular pattern

I would like to find files not matching *.jpg (case insensitive), can
anyone tell me how to use GNU find to do that? I know I can use -
iname to be case insensitive but I can't find out how to exclude all
the files that match rather than include them.
Eliot [ Fr, 30 November 2007 11:35 ] [ ID #1882428 ]

Re: Find files not matching a particular pattern

At 2007-11-30 05:35AM, "Eliot" wrote:
> I would like to find files not matching *.jpg (case insensitive), can
> anyone tell me how to use GNU find to do that? I know I can use -
> iname to be case insensitive but I can't find out how to exclude all
> the files that match rather than include them.

find . -type f \( ! -iname \*.jpg \) -print

--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
Glenn Jackman [ Fr, 30 November 2007 12:53 ] [ ID #1882437 ]

Re: Find files not matching a particular pattern

On 2007-11-30, Glenn Jackman <glennj [at] ncf.ca> wrote:
> At 2007-11-30 05:35AM, "Eliot" wrote:
>> I would like to find files not matching *.jpg (case insensitive), can
>> anyone tell me how to use GNU find to do that? I know I can use -
>> iname to be case insensitive but I can't find out how to exclude all
>> the files that match rather than include them.
>
> find . -type f \( ! -iname \*.jpg \) -print

or also
find . -type f ! -iname '*.jpg'



--
There is an art, it says, or rather, a knack to flying.
The knack lies in learning how to throw yourself at the ground and miss.
Douglas Adams
Rikishi 42 [ Sa, 01 Dezember 2007 20:01 ] [ ID #1883398 ]
Linux » comp.unix.shell » Find files not matching a particular pattern

Vorheriges Thema: shell scripts interpret
Nächstes Thema: Daylight saving time DST and timestamp handling