Find files not matching a particular pattern
am 30.11.2007 11:35:35 von Eliot
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.
Re: Find files not matching a particular pattern
am 30.11.2007 12:53:12 von Glenn Jackman
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
Re: Find files not matching a particular pattern
am 01.12.2007 20:01:54 von Rikishi 42
On 2007-11-30, Glenn Jackman 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