The Computer Oracle

How to change a symlink in OS X?

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Ancient Construction

--

Chapters
00:00 How To Change A Symlink In Os X?
00:33 Answer 1 Score 0
00:45 Accepted Answer Score 10
01:03 Answer 3 Score 1
01:13 Answer 4 Score 12
01:20 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.