删除目录的符号链接

馋奶兔 提交于 2020-08-06 09:55:23

问题:

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 -frm -rfsudo 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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!