Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot overwrite Symbolic Link RedHat Linux

I have created a symbolic link:

sudo ln -s /some/dir new_dir 

Now I want to overwrite the symbolic link to point to a new location and it will not overwrite. I have tried:

sudo ln -f -s /other/dir new_dir 

I can always sudo rm new_dir, but I would rather have it overwrite accordingly if possible. Any ideas?

like image 929
Chuck Burgess Avatar asked Mar 09 '11 18:03

Chuck Burgess


1 Answers

ln -sfn /other/dir new_dir 

works for me. The -n doesn't dereference the destination symlink.

like image 79
ire_and_curses Avatar answered Oct 08 '22 03:10

ire_and_curses