如何删除符号链接?
我刚刚创建了 符号链接 sudo ln -s /usr/local/mysql/lib /libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
我想知道:如果我想的话,我怎样才能摆脱它?我该怎么做?
I just created the symbolic link sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
and am wondering: how can I get rid of it if I wanted to? How would I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
就像删除任何其他文件一样删除它:
rm /usr/lib/libmysqlclient.18.dylib
。 rm 将删除符号链接本身,而不是链接指向的文件。Remove it just like you would any other file:
rm /usr/lib/libmysqlclient.18.dylib
. rm will remove the symlink itself, not the file the link is pointing at.您可以使用取消链接命令:
unlink /path/to/sym/link
删除 Finder 也可以正常工作。它上面会有一个小快捷方式图标。
You can use the unlink command:
unlink /path/to/sym/link
Deleting the file within Finder also works fine. It will have a little shortcut icon on it.
只需运行:
这将删除文件(即符号链接)。
或者,您可以使用取消链接:
Just run:
This will remove the file (i.e. the symlink).
Alternatively you may use unlink:
不知何故,我有一个指向不存在的文件夹的符号链接。我不知道它是如何发生的,但要删除它,我发现最简单的方法是在 Finder 并手动删除它。我花了一个小时尝试使用 Terminal。
Somehow I had a symlink to a non-existing folder. I don't have any idea how it happened, but to remove it I found the easiest way was open in Finder and manually delete it. I came to this decision after an hour wasted on trying to delete it with the Terminal.
我有一个链接指向一个短名称为“testproject”的文件夹:
你用这个命令来做到这一点,
当我运行指向旧文件夹目录的命令 unlink 时,由于某些原因,我不得不将文件夹名称更改为其他名称,但它不起作用。
我尝试仅
取消链接 testproject
来删除短名称,以便我可以再次重复使用相同的名称并链接到新命名的文件夹。它确实对我有用。I had a link pointing to a folder with short-name "testproject":
you make that with this command
I had to change the folder name to something else for some reasons when I run the command unlink pointing to the old folder directory it didn't work.
I tried to only
unlink testproject
to remove the short-name so I can re-use the same name again and link to the newly named folder. it did work fine for me.您可以使用 sudo rm /usr/lib/libmysqlclient.18.dylib 删除该链接
You could remove that link with
sudo rm /usr/lib/libmysqlclient.18.dylib
要删除符号链接,您可以在终端中使用
unlink
命令。例如,如果符号链接名为mysymlink
,则命令将为unlink mysymlink
。To remove a symlink, you can use the
unlink
command in the terminal. For example, if the symlink is calledmysymlink
, the command would beunlink mysymlink
.