删除指向不存在目录的符号链接的安全方法(对于python二进制文件) [英] Safe way to remove a symbolic link to an non-existing directory (for the python binary)
本文介绍了删除指向不存在目录的符号链接的安全方法(对于python二进制文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不小心输入了
sudo ln -sf /usr/local/bin/python2.5/ /usr/bin/python
而不是:
sudo ln -sf /usr/local/bin/python2.5 /usr/bin/python
现在bash告诉我,每当我运行python时,/ usr / bin / python都不是目录。
Now bash tells me that /usr/bin/python is not a directory whenever I run python.
ls -l /usr/bin/python gives me expectedly /usr/bin/python --> /usr/local/bin/python2.5/
有没有安全的方法可以删除该符号链接到目录(不存在)并用指向目标文件的链接替换?
Is there any safe way to remove that symbolic link to a directory (that does not exist) and replace it with a link to the intended file?
如果有任何想法,请提前提供Arigato。
Arigato in advance if you have any ideas.
我被卡住了。...
推荐答案
您只需使用rm删除链接:
you can simply remove the link with rm :
rm /usr/bin/python
这篇关于删除指向不存在目录的符号链接的安全方法(对于python二进制文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文