With some [read LOTS] of help on IRC, I found way to do this:

find dir1/ -lname /dir2 | xargs rm

this find all files in dir1 which link to dir2 (it's important to know
whether you want to find files that link relatively or absolutely), then
pipes this info to xargs and rm.  Try it just up to the pipe to see how
it lists the links.  

For mroe info, check out "man find" and "man xargs"

-Paul Rodríguez

On Mon, 2001-12-03 at 16:47, Paul Rodríguez wrote:
> Ok 
> 
> Lets say I have files in Dir2 which I have symlinks for in Dir1.  
> So the contents of Dir1 include links to all the files in Dir2, plus
> files of its own...
> 
> I want to delete all of those symlinks in Dir1 for Dir2, without
> deleting anything else, or going through them one by one...
> 
> Is there a way I can say something like..
>       rm -rf /Dir1/(output of ls Dir2)
> 
> Or, said another way...
> 
>       rm -rf /Dir1/(all symlinks to contents of Dir2)
> 
> 
> Thanks!
> 
> -Paul Rodríguez
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> 
> ------------=_1007416123-31033-1102
> Want to buy your Pack or Services from MandrakeSoft? 
> Go to http://www.mandrakestore.com



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to