LinHES Forums
http://forum.linhes.org/

Removing a symlink to self ?
http://forum.linhes.org/viewtopic.php?f=5&t=19833
Page 2 of 2

Author:  hollymcr [ Fri Sep 02, 2011 8:47 am ]
Post subject:  [SOLVED] Re: Removing a symlink to self ?

chrisj wrote:
I messed up a symlink and now can't remove it

rm -rf video dose not do it , any hints ?

Code:
video -> video


Old thread but the only one that comes up in Google for this problem, and I found a workaround so I thought I'd post it in case its useful to anyone else.

The trick is to relink to something else (whether or not the something else exists is irrelevant). So:
Code:
ln -sf x video
rm video

.. first forces ln to replace the link with a new one pointing to non-existant file "x", then rm is allowed to remove it.

(In my case this was not on a KnoppMyth system but an old Linux web server but I think the solution would be fairly general.)

Author:  mattbatt [ Fri Sep 02, 2011 9:55 pm ]
Post subject: 

thanks Hollymcr for creating an account just to help the community. 2 Karma points for you. :)

Author:  hollymcr [ Mon Sep 05, 2011 3:08 am ]
Post subject: 

mattbatt wrote:
thanks Hollymcr for creating an account just to help the community. 2 Karma points for you. :)


Thanks, but in the interests of honesty I already had the account having created it several years ago but never actually posted using it!

Hopefully I'll get chance to play with Myth again shortly, never quite got to a working system (but that was several years ago!)

Page 2 of 2 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/