Re: Reverse Wildcarding

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Matt Alexander
Date:  
To: plug-discuss
Subject: Re: Reverse Wildcarding
On Tue, 15 Jun 2004, Matt Alexander wrote:

> On Tue, 15 Jun 2004, Kyle Faber wrote:
>
> > I'm sure its possible, but is there a 'quick' way to reverse a wildcard?
> >
> > Say I wanted a list of all the "not Jpegs" in a directory? How difficult
> > would crafting the following command be?
> >
> > ls [Everything that is not] *.jpg
> >
> > It would be awesome if I could transfer this syntax to all commands (how easy
> > would directory cleanup be if I could reverse an rm command?)
>
> ls -I \*.jpg


And to continue my previous response, you can delete all files that are
not *.jpg like this:

ls -I \*.jpg | xargs rm



---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss