Since the Link from mikeytown2s comment is broken, i will explain why redent84s answer is better:
While
ln -sfn newDir currentDir
does the job, it is not an atomic operation, as you can see with strace:
$ strace ln -snf newDir currentDir 2>&1 | grep link
unlink("currentDir") = 0
symlink("newDir", "currentDir") = 0
This is important when you have a webserver root pointing to that symlink. It could cause errors while the symlink is deleted and created again - even in the timespan of a microsecond.
To prevent errors use instead:
$ ln -s newDir tmpCurrentDir && mv -Tf tmpCurrentDir currentDir
This will create a temporary Link and after that overwrite currentDir in an atomic operation.
-h If the target_file or target_dir is a symbolic link, do not follow it. This is most useful with the -f option, to replace a symlink which may point to a directory.
– Resilient