The Computer Oracle

How to change a symlink in OS X?

--------------------------------------------------
Become or hire the top 3% of the developers on Toptal https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Secret Catacombs

--

Chapters
00:00 Question
00:50 Accepted answer (Score 10)
01:11 Answer 2 (Score 55)
02:02 Answer 3 (Score 12)
02:14 Answer 4 (Score 1)
02:28 Thank you

--

Full question
https://superuser.com/questions/36626/ho...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #osxleopard #path #symboliclink

#avk47



ANSWER 1

Score 12


Try:

unlink /path/to/current/link
ln -s /path/to/target /path/to/symbolic/link



ACCEPTED ANSWER

Score 10


mkdir /path/where/newsymlink
ln -s /path/to/point/to /path/where/newsymlink/is
mv /path/where/newsymlink/is /path/where/symlink/
rmdir /path/where/newsymlink

However, the Java Preferences utility changes more than just a symbolic link; you should use that to ensure that the Java version is changed.




ANSWER 3

Score 1


The ln command doesn't let you change links, only create new ones.




ANSWER 4

Score 0


Have you compared the permissions on the links and on the targets before and after you change the link? You might just need to follow up with the appropriate chown and chmod commands to get it working.