Re: Reverse Wildcarding

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Ed Skinner
Date:  
To: plug-discuss
Subject: Re: Reverse Wildcarding
Here's the next step but you'll want to be careful with the "rm" command...

rm `ls | grep -v .jpg`

Note the back single quotes are on the key next to the "1" character. When you
put these around some commands, they are executed and their stdout is
captured, and that stdout is then dropped in, in place of the back quoted
expression and the outer "rm ..." is then executed.



On Tuesday 15 June 2004 17:05, Kyle Faber wrote:
> Evening,
>
> 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?)
>
> Ideas?
>
> Kyle Faber
> EMR Internet
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


--
Ed Skinner, , http://www.flat5.net/

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