i just created the symlink sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
and am wondering how i get rid of it if I wanted to. How would i do this?
7 Answers
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.

- 356,200
- 43
- 426
- 500
-
for me on macOs it the command line jus stopped waiting for something I gave up waiting and deleted the symlink from Finder. – Yevgeniy Afanasyev Feb 21 '18 at 04:08
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.

- 10,532
- 12
- 48
- 63
Just run:
rm /usr/lib/libmysqlclient.18.dylib
This will remove the file (i.e. the symlink).
Alternatively you may use unlink:
unlink /usr/lib/libmysqlclient.18.dylib

- 5,073
- 4
- 35
- 46
I had a link pointing to a folder with short-name "testproject": you make that with this command
ln -s /Users/SHERIF/repo/test testproject
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.

- 97
- 1
- 5
Somehow I had a symlink to a non-existing folder. Have no 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.

- 1,062
- 8
- 6
You could remove that link with sudo rm /usr/lib/libmysqlclient.18.dylib

- 223,805
- 18
- 296
- 547
To remove a symlink, you can use the unlink
command in the terminal. For example, if the symlink is called mysymlink
, the command would be unlink mysymlink
.

- 17,146
- 13
- 40
- 131

- 1
- 1