Re: How to safely delete a Symlink

From: Thomas Schweikle (tpsX_at_vr-web.de)
Date: 05/10/04


Date: Mon, 10 May 2004 02:42:44 +0200

Ditch Brodie wrote:
> Sorry about this group, but I'm at my ends here. Please review my previous
> post on this from 4/27/2004. Again, so many things said but yet nothing
> confirms, answers or even hints at the correct answer...
>
> I create a sym link like this:
>
> ln -s /usr/share/docs /html/FreeBSD-Documents
>
> Then later when I go to remove the symlink with:
>
> rm -r /html/FreeBSD-Documents
>
> the /usr/share/docs folder gets erased. Please guys don't get me wrong, but
> my previous post said I've asked this question of the group before and all
> the happens are a bunch of responses which basically say try what I've
> already tried. For the hard of hearing...
>
> IF I TYPE
>
> rm -r /html/FreeBSD-Documents
>
> THE WHOLE DAMN DIRECTORY THAT THE LINK POINTS TO WILL BE DESTROYED. PLEASE
> DO NOT REPLY TO THIS IF ALL YOU'RE GOING TO SUGGEST IS THAT THIS SHOULDN'T
> ERASE THE FOLDER THAT THE LINK POINTS TO BECAUSE IT DOES. I'VE TRIED IT A
> DOZEN TIMES AND EACH TIME THE FOLDER I WANT TO KEEP GETS WHACKED ALONG WITH
> THE LINK.
>
> Any new suggestions are welcomed.

That's normal. You'll have to delete a link using:

   rm /html/FreeBSD-Documents

Using

   rm -r /html/FreeBSD-Documents

will in all cases erase the directory the link points to. Why?
Because you advised rm to recurse trough the whole directory tree
given as argument. And this is just like

   cd /html/FreeBSD-Documents

Aint you are awaiting this to work? Yes. You do! If you didn't what
would be a link for? Useless if pointing to a directory!

-- 
Thomas


Relevant Pages

  • Re: How to safely delete a Symlink
    ... answers or even hints at the correct answer... ... > I create a sym link like this: ... > ERASE THE FOLDER THAT THE LINK POINTS TO BECAUSE IT DOES. ... > DOZEN TIMES AND EACH TIME THE FOLDER I WANT TO KEEP GETS WHACKED ALONG WITH ...
    (comp.unix.bsd.freebsd.misc)
  • How to safely delete a Symlink
    ... Please review my previous ... ERASE THE FOLDER THAT THE LINK POINTS TO BECAUSE IT DOES. ... DOZEN TIMES AND EACH TIME THE FOLDER I WANT TO KEEP GETS WHACKED ALONG WITH ...
    (comp.unix.bsd.freebsd.misc)
  • Windows Explorer
    ... Explorer use far too much memory and lock it up untill I reboot. ... little more than 2 GB and then it stoped to respond, often Windows do not ... Normally its no problem to erase thousends of files but now I can only erase ... Windows cant even show all file icons in a folder. ...
    (microsoft.public.windowsxp.general)
  • Re: How to safely delete a Symlink
    ... Someone please turn me towards the east and kindly kick my rear for being so ... will disappear like this.....my tired overworked eyes just didn't catch it. ... > DOZEN TIMES AND EACH TIME THE FOLDER I WANT TO KEEP GETS WHACKED ALONG ...
    (comp.unix.bsd.freebsd.misc)
  • Re: What should do if need to do full erase and install
    ... So, if one just backs up the MUD folder, and then puts the MUD folder into ... Is having to erase a HD because of permissions a common thing? ... >>> I use Entourage, Excel, and Word. ...
    (microsoft.public.mac.office.entourage)