When I move a directory elsewhere, a symblink to it will become invalid.The way I update a symlink mylink is first going into the directory, and then running ln -s $PWD mylink, and then mv mylink to the invalid symlink.I can't create the new symlink in the same directory of the invalid symlink using the above ln command, because ln: failed to create symbolic linkmylink': File exists, so I have to create it elsewhere and then there is an additional mv step.I wonder if an existing invalid symlink can be edited directly, just like editing a text file in a text editor such as Emacs?
Can a symlink be edited to link to a different directory or file?
symlink