update symbolic link

the command to update the symbolic link is trivial,

ln -sf newPath link

`-f` basically force the overwrite if the link is already existing.

however, the caveat is if the link is pointing to a folder, `-n` is also needed, otherwise it will create a symbolic link to the newPath inside link.

ln -sfn newPath link

even further, even if -n is used, however, if there is `/` after the link (tab completion would do that), the newPath would still be symbolinked into link as a subfolder.

## this won't work
ln -sfn newPath link/  

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s