BrainLikeADullPencil
BrainLikeADullPencil

Reputation: 11673

symbolic links broken after installing mavericks

I just updated to Mavericks and it has broken my sym links to Sublime Text, which I used to open by running the sub command. Therefore, I tried to create a new symlink by doing this

sudo ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" /bin/sub

When I run the command sub, it says the command isn't found.

When I tried to create the symlink again by doing

sudo ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" /bin/sub

it said

ln: /bin/sub: File exists

Any idea what I've done wrong or how I can get it to work?

Upvotes: 0

Views: 189

Answers (1)

BrainLikeADullPencil
BrainLikeADullPencil

Reputation: 11673

The problem here is, I was both enclosing the path in quotes and inserting a backslash before the space. Doing so links to a non-existant file at a path which actually has a real backslash character in its name. The symlink exists, but its target doesn't. Instead, I should have beeen creating the symlink like so:

sudo rm /bin/sub;
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /bin/sub

However, it's best to not make modifications to the /bin directory. Instead, it's safer to use the /usr/local hierarchy like so:

sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sub

Thanks to 5HT-2a

Upvotes: 1

Related Questions