问题:
I have a symlink to an important directory. 我有一个重要目录的符号链接。 I want to get rid of that symlink, while keeping the directory behind it. 我想摆脱那个符号链接,同时保持它背后的目录。
I tried rm
and get back rm: cannot remove 'foo'
. 我试过rm
然后回来rm: cannot remove 'foo'
。
I tried rmdir
and got back rmdir: failed to remove 'foo': Directory not empty
我尝试了rmdir
并找回了rmdir: failed to remove 'foo': Directory not empty
I then progressed through rm -f
, rm -rf
and sudo rm -rf
然后我通过rm -f
, rm -rf
和sudo rm -rf
进展
Then I went to find my back-ups. 然后我去寻找我的备份。
Is there a way to get rid of the symlink with out throwing away the baby with the bathwater? 有没有办法摆脱符号链接,而不是用洗澡水扔掉婴儿?
解决方案:
参考一: https://stackoom.com/question/sf2/删除目录的符号链接参考二: https://oldbug.net/q/sf2/Remove-a-symlink-to-a-directory
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4313809