Tuesday, October 13th, 2009

HOWTO: Remove a Symbolic Link

October 31, 2005 by Jon  
Filed under How To

This may seem not seem complicated, but if you don’t know, you don’ t know.

When you create a symbolic link, the link file you’ve created just points to the target file. Therefore, the link file has no other purpose in life than that. So, when you want to get rid of it, just delete the link file.

Done.

  • StumbleUpon
  • Digg
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Reddit
  • Yahoo! Buzz
  • Slashdot

Comments

55 Responses to “HOWTO: Remove a Symbolic Link”
  1. Hoaobrook says:

    JON, thanks for posting. I preferred the unlink method as any RM commands have to be validated by the administrator here – why? we had a newbie accidently run an rm -rf from root :( – at any rate, good on ya for posting this helpful bit. I was a little worried about running rm on the link thinking it might follow the link and delete the files ( I had the link on a folder).

  2. BartO says:

    Ok, symbolic links are just really weird. Not only the rm -rf command follows the link, just rm seems to do it as well. That is, it doesn’t do anything for it thinks the link is a dirictory, and non-empty directories can’t be removed by just rm. But when I delete the link by pushing shift-del in nautilus, the link is removed whitout doing harm to the directory it pointed to. Both are done as root. I don’t get it…

    • whitethorn says:

      I just had the same problem, the mistake was using

      rm nameofsymlink/
      what you have to run is
      rm nameofsymlink

      without the backspace, the first one is trying to get rid of the folder being pointed to, while the second is just using the name of the file.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


About Us | Advertise with us | Blog for EveryJoe | Privacy Policy | Terms of Use
Get This Theme | Sitemap


All content is Copyright © 2005-2009 b5media. All rights reserved.